├── .editorconfig
├── .github
└── ISSUE_REPLY_TEMPLATE.md
├── .gitignore
├── CodeArts.Caching.md
├── CodeArts.Casting.md
├── CodeArts.Configuration.md
├── CodeArts.Db.EntityFramework.md
├── CodeArts.Db.Linq2Sql.md
├── CodeArts.Db.Lts.md
├── CodeArts.Db.md
├── CodeArts.Json.md
├── CodeArts.Middleware.md
├── CodeArts.Mvc.md
├── CodeArts.Net.md
├── CodeArts.sln
├── LICENSE.txt
├── ORM_UML.svg
├── README.md
├── Tests
├── CodeArts.Db.Dapper.Tests
│ ├── CodeArts.Db.Dapper.Tests.csproj
│ ├── Domain
│ │ └── Entities
│ │ │ ├── FeiUserdetails.cs
│ │ │ └── FeiUsers.cs
│ ├── Serialize
│ │ └── SqlServerConnectionAttribute.cs
│ ├── SkyDbContext.cs
│ ├── SqlServerConsts.cs
│ └── UnitTest1.cs
├── CodeArts.Db.EntityFramework.Tests
│ ├── CodeArts.Db.EntityFramework.Tests.csproj
│ ├── DbTestContext.cs
│ ├── Domain
│ │ ├── Entities
│ │ │ ├── FeiUserWeChat.cs
│ │ │ ├── FeiUserdetails.cs
│ │ │ └── FeiUsers.cs
│ │ ├── UserDetailsRepository.cs
│ │ ├── UserRepository.cs
│ │ └── UserWeChatRepository.cs
│ ├── Dtos
│ │ ├── TaxCodeTreeSimDto.cs
│ │ ├── UserInDto.cs
│ │ └── UserSimDto.cs
│ ├── Enums
│ │ ├── AuthShipEnum.cs
│ │ ├── AuthTreeEnum.cs
│ │ ├── CommonStatusEnum.cs
│ │ ├── OrgTreeEnum.cs
│ │ ├── UserRole.cs
│ │ └── UserSex.cs
│ ├── Serialize
│ │ ├── DefaultDbConfigAttribute.cs
│ │ └── SqlServerConnectionAttribute.cs
│ ├── Sql
│ │ ├── mssql.sql
│ │ └── mysql.sql
│ ├── SqlServerConsts.cs
│ ├── SqlServerTest.cs
│ └── UnitTest1.cs
├── CodeArts.Db.Lts.Tests
│ ├── CodeArts.Db.Lts.Tests.csproj
│ ├── Domain
│ │ ├── AuthShipRepository.cs
│ │ ├── AuthTreeRepository.cs
│ │ ├── Entities
│ │ │ ├── AuthShip.cs
│ │ │ ├── AuthTree.cs
│ │ │ ├── FeiUserWeChat.cs
│ │ │ ├── FeiUserdetails.cs
│ │ │ ├── FeiUsers.cs
│ │ │ ├── OrgTree.cs
│ │ │ ├── OrmTest.cs
│ │ │ ├── OssBuckets.cs
│ │ │ ├── TaxCode.cs
│ │ │ └── User.cs
│ │ ├── MySqlUserRespository.cs
│ │ ├── OrgTreeRepository.cs
│ │ ├── OrmTestRepository.cs
│ │ ├── TaxCodeRepository.cs
│ │ ├── UserDetailsRepository.cs
│ │ ├── UserRepository.cs
│ │ └── UserWeChatRepository.cs
│ ├── Dtos
│ │ ├── TaxCodeTreeSimDto.cs
│ │ ├── UserInDto.cs
│ │ └── UserSimDto.cs
│ ├── Enums
│ │ ├── AuthShipEnum.cs
│ │ ├── AuthTreeEnum.cs
│ │ ├── CommonStatusEnum.cs
│ │ ├── OrgTreeEnum.cs
│ │ ├── OssAclEnum.cs
│ │ ├── OssAlgorithmEnum.cs
│ │ ├── OssKmsEncryptionAlgorithmEnum.cs
│ │ ├── OssStorageEnum.cs
│ │ ├── UserRole.cs
│ │ └── UserSex.cs
│ ├── MySqlConsts.cs
│ ├── MySqlTest.cs
│ ├── SQLTest.cs
│ ├── Serialize
│ │ ├── DateTimeTokenAttribute.cs
│ │ ├── DefaultDbConfigAttribute.cs
│ │ └── SqlServerConnectionAttribute.cs
│ ├── Sql
│ │ ├── mssql.sql
│ │ └── mysql.sql
│ ├── SqlServerConsts.cs
│ ├── SqlServerTest.cs
│ ├── ThreadSecurityTest.cs
│ └── UnitTest1.cs
├── CodeArts.Emit.Tests
│ ├── Class1.cs
│ ├── CodeArts.Emit.Tests.csproj
│ └── UnitTest1.cs
├── CodeArts.Tests
│ ├── CodeArts.Tests.csproj
│ ├── CryptoExtentions.cs
│ ├── DesignModeTest.cs
│ ├── EnumExtensions.cs
│ ├── Enums
│ │ └── RoleEnum.cs
│ ├── ExpressionTest.cs
│ ├── KeyGenTest.cs
│ ├── NormalTests.cs
│ ├── ObjectExtentions.cs
│ ├── StringExtentions.cs
│ ├── TestAttributes.cs
│ ├── UriExtentions.cs
│ └── packages.config
├── ConsoleEmit
│ ├── App.config
│ ├── ConsoleEmit.csproj
│ ├── MyTest.cs
│ ├── Program.cs
│ └── Properties
│ │ └── AssemblyInfo.cs
├── GrpcClient
│ ├── GrpcClient.csproj
│ ├── Program.cs
│ ├── Protos
│ │ └── push.proto
│ ├── appsettings.Development.json
│ └── appsettings.json
├── MVC461
│ ├── App_Start
│ │ └── WebApiConfig.cs
│ ├── Controllers
│ │ └── ValuesController.cs
│ ├── Domain
│ │ ├── Entities
│ │ │ └── User.cs
│ │ └── UserRepository.cs
│ ├── MVC461.csproj
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── Startup.cs
│ ├── Web.Debug.config
│ ├── Web.Release.config
│ ├── Web.config
│ └── packages.config
├── Mvc.Core
│ ├── Controllers
│ │ ├── ValuesController.cs
│ │ └── WeatherForecastController.cs
│ ├── Domain
│ │ ├── EfContext.cs
│ │ ├── Entities
│ │ │ ├── FeiUsers.cs
│ │ │ └── User.cs
│ │ └── UserRepository.cs
│ ├── Dtos
│ │ └── UserDto.cs
│ ├── Mvc.Core.csproj
│ ├── Program.cs
│ ├── Protos
│ │ └── push.proto
│ ├── Services
│ │ └── PushService.cs
│ ├── Startup.cs
│ ├── WeatherForecast.cs
│ ├── appsettings.Development.json
│ ├── appsettings.json
│ └── log4net.config
├── Mvc.Core2_1
│ ├── Controllers
│ │ └── ValuesController.cs
│ ├── Domain
│ │ ├── Entities
│ │ │ └── User.cs
│ │ └── UserRepository.cs
│ ├── Mvc.Core2_1.csproj
│ ├── Program.cs
│ ├── Startup.cs
│ ├── appsettings.Development.json
│ ├── appsettings.json
│ └── log4net.config
├── Mvc4
│ ├── Controllers
│ │ └── ValuesController.cs
│ ├── Mvc4.csproj
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── Startup.cs
│ ├── Views
│ │ └── TestView.cs
│ ├── Web.Debug.config
│ ├── Web.Release.config
│ ├── Web.config
│ └── packages.config
└── Mvc45
│ ├── Controllers
│ └── ValuesController.cs
│ ├── Mvc45.csproj
│ ├── Properties
│ └── AssemblyInfo.cs
│ ├── Startup.cs
│ ├── Web.Debug.config
│ ├── Web.Release.config
│ ├── packages.config
│ └── web.config
├── appveyor.yml
├── build.ps1
├── codearts.png
├── project.json
└── src
├── CodeArts.Caching
├── BaseCaching.cs
├── CachingManager.cs
├── CodeArts.Caching.csproj
├── ICaching.cs
├── ICachingProvider.cs
├── Level.cs
└── MultiCaching.cs
├── CodeArts.Casting
├── CastingMapper.cs
├── CastingStartup.cs
├── CodeArts.Casting.csproj
├── Expressions
│ ├── AutomaticMap.cs
│ ├── ConstructorMap.cs
│ ├── ConversionOperatorMap.cs
│ ├── ConvertMap.cs
│ ├── EnumToEnumMap.cs
│ ├── EnumerableMap.cs
│ ├── FromKvStringMap.cs
│ ├── KeyValueMap.cs
│ ├── ParseStringMap.cs
│ ├── StringToEnumMap.cs
│ ├── ToKvStringMap.cs
│ └── UnderlyingTypeEnumMap.cs
├── IMapConfiguration.cs
├── IMapExpression.cs
├── IProfile.cs
├── IProfileConfiguration.cs
├── IProfileExpression.cs
├── IProfileMap.cs
├── MapExpression.cs
├── Mapper.cs
├── ProfileConfiguration.cs
├── ProfileExpression.cs
└── SimpleExpression.cs
├── CodeArts.Configuration
├── CodeArts.Configuration.csproj
├── ConfigurationStartup.cs
└── DefaultConfigHelper.cs
├── CodeArts.Db.Dapper
├── CodeArts.Db.Dapper.csproj
├── DapperConnectionManager.cs
└── DbContext.cs
├── CodeArts.Db.EntityFramework.SqlServer
├── CodeArts.Db.EntityFramework.SqlServer.csproj
└── SqlServerLinqAdapter.cs
├── CodeArts.Db.EntityFramework.Sqlite
├── CodeArts.Db.EntityFramework.Sqlite.csproj
└── SqliteLinqAdapter.cs
├── CodeArts.Db.EntityFramework
├── CodeArts.Db.EntityFramework.csproj
├── DbContext.cs
├── DbTransaction.cs
├── DbTransactionProvider.cs
├── EntityFrameworkServiceCollectionExtentions.cs
├── IDbConnectionLinqAdapter.cs
├── IDbTransaction.cs
├── IDbTransactionProvider.cs
├── ILinqRepository.cs
├── LinqConnectionManager.cs
├── LinqRepository.cs
└── QueryableExtentions.cs
├── CodeArts.Db.Linq2Sql
├── CodeArts.Db.Linq2Sql.csproj
├── CommandBehavior.cs
├── CustomVisitorList.cs
├── ExpressionExtensions.cs
├── Expressions
│ ├── AllVisitor.cs
│ ├── AnyVisitor.cs
│ ├── AverageVisitor.cs
│ ├── BaseVisitor.cs
│ ├── CombinationVisitor.cs
│ ├── CoreVisitor.cs
│ ├── DeleteVisitor.cs
│ ├── ExecuteVisitor.cs
│ ├── GroupByLinqVisitor.cs
│ ├── GroupByVisitor.cs
│ ├── GroupJoinVisitor.cs
│ ├── HavingVisitor.cs
│ ├── InsertVisitor.cs
│ ├── JoinSelectVisitor.cs
│ ├── JoinVisitor.cs
│ ├── LinqAnyVisitor.cs
│ ├── LinqContainsVisitor.cs
│ ├── MaxVisitor.cs
│ ├── MinVisitor.cs
│ ├── NestedAllVisitor.cs
│ ├── NestedAnyVisitor.cs
│ ├── NestedContainsVisitor.cs
│ ├── QueryVisitor.cs
│ ├── SelectVisitor.cs
│ ├── SetContainsVisitor.cs
│ ├── SetExistsVisitor.cs
│ ├── SumVisitor.cs
│ ├── UpdateVisitor.cs
│ └── WhereVisitor.cs
├── Extentions
│ └── RepositoryExtentions.cs
├── ICustomVisitor.cs
├── ICustomVisitorList.cs
├── IExecuteVisitor.cs
├── IQueryVisitor.cs
├── IStartupVisitor.cs
├── IVisitor.cs
├── IWriterMap.cs
├── MethodCall.cs
├── QueryableMethods.cs
├── TypeExtensions.cs
├── Types.cs
├── Writer.cs
└── WriterMap.cs
├── CodeArts.Db.Lts.MySql
├── CodeArts.Db.Lts.MySql.csproj
├── MySqlLtsAdapter.cs
└── Visiters
│ └── ConvertVisitter.cs
├── CodeArts.Db.Lts.SqlServer
├── CodeArts.Db.Lts.SqlServer.csproj
├── SqlServer2012LtsAdapter.cs
├── SqlServerLtsAdapter.cs
└── Visiters
│ └── ConvertVisitter.cs
├── CodeArts.Db.Lts
├── CodeArts.Db.Lts.csproj
├── DRepository.cs
├── DapperFor.cs
├── DatabaseFactory.cs
├── DatabaseFor.cs
├── DbConnectionAdapter.cs
├── DbConnectionManager.cs
├── DbRepository.cs
├── Extentions
│ ├── QueryableAsyncExtentions.cs
│ └── RepositoryExtentions.cs
├── IAsyncQueryProvider.cs
├── IDRepository.cs
├── IDatabase.Async.cs
├── IDatabase.cs
├── IDatabaseFor.cs
├── IDbConnectionLtsAdapter.cs
├── IDbRepository.cs
├── IRepository.cs
├── QueryableAsync.cs
├── Repository.cs
└── Types.cs
├── CodeArts.Db.MySql
├── CodeArts.Db.MySql.csproj
├── MySqlAdapter.cs
├── MySqlCorrectSettings.cs
└── MySqlFactory.cs
├── CodeArts.Db.SqlServer
├── CodeArts.Db.SqlServer.csproj
├── Formatters
│ ├── CreateIfFormatter.cs
│ └── DropIfFormatter.cs
├── SqlServer2012Adapter.cs
├── SqlServer2012CorrectSettings.cs
├── SqlServerAdapter.cs
├── SqlServerCorrectSettings.cs
└── SqlServerFactory.cs
├── CodeArts.Db.Sqlite
├── CodeArts.Db.Sqlite.csproj
├── SqliteAdapter.cs
├── SqliteCorrectSettings.cs
└── SqliteFactory.cs
├── CodeArts.Db
├── AdapterFormatter.cs
├── BaseEntity.cs
├── CodeArts.Db.csproj
├── CommandSql.cs
├── CommandTypes.cs
├── CommonSettings.cs
├── ConnectionConfig.cs
├── DatabaseEngine.cs
├── DbConfigAttribute.cs
├── DbConnectionFactory.cs
├── DbReadConfigAttribute.cs
├── DbServiceRouter.cs
├── DbServiceSet.cs
├── DbValidator.cs
├── DbWriteConfigAttribute.cs
├── DefaultSqlAdpter.cs
├── DispatchConnections.cs
├── Exceptions
│ ├── DException.cs
│ ├── DRequiredException.cs
│ ├── DSyntaxErrorException.cs
│ ├── NonAuthorizedException.cs
│ ├── NotImplementedKeyException.cs
│ └── TypeAccessInvalidException.cs
├── ExpressionCombine.cs
├── Extentions
│ └── QueryableExtentions.cs
├── IDbConnectionAdapter.cs
├── IDbConnectionFactory.cs
├── IDbRouter.cs
├── IDispatchConnections.cs
├── IEntiy.cs
├── IFormatter.cs
├── IReadOnlyConnectionConfig.cs
├── ISQLCorrectSettings.cs
├── ISqlAdpter.cs
├── ITableInfo.cs
├── LookupDb.cs
├── ParameterToken.cs
├── ParameterValue.cs
├── Routes
│ ├── IDeleteable.cs
│ ├── IInsertable.cs
│ └── IUpdateable.cs
├── SQL.cs
├── TableRegions.cs
├── TableToken.cs
├── TokenAttribute.cs
├── TransactionConnections.cs
└── Types.cs
├── CodeArts.DependencyInjection.Abstractions
├── CodeArts.DependencyInjection.Abstractions.csproj
├── Extensions
│ └── ServiceCollectionDescriptorExtensions.cs
├── IServiceCollection.cs
├── IServiceProviderFactory.cs
├── IServiceScope.cs
├── IServiceScopeFactory.cs
├── ISupportRequiredService.cs
├── ServiceCollectionServiceExtensions.cs
├── ServiceDescriptor.cs
├── ServiceLifetime.cs
└── ServiceProviderServiceExtensions.cs
├── CodeArts.DependencyInjection
├── CodeArts.DependencyInjection.csproj
├── DefaultServiceProviderFactory.cs
├── ServiceCollection.cs
├── ServiceCollectionContainerBuilderExtensions.cs
├── ServiceLookup
│ ├── CallSiteChain.cs
│ ├── CallSiteExpressionBuilderContext.cs
│ ├── CallSiteFactory.cs
│ ├── CallSiteKind.cs
│ ├── CallSiteResultCacheLocation.cs
│ ├── CallSiteRuntimeResolver.cs
│ ├── CallSiteValidator.cs
│ ├── CallSiteVisitor.cs
│ ├── CompiledServiceProviderEngine.cs
│ ├── ConstantCallSite.cs
│ ├── ConstructorCallSite.cs
│ ├── CreateInstanceCallSite.cs
│ ├── DynamicServiceProviderEngine.cs
│ ├── Expressions
│ │ ├── ExpressionResolverBuilder.cs
│ │ └── ExpressionsServiceProviderEngine.cs
│ ├── FactoryCallSite.cs
│ ├── IEnumerableCallSite.cs
│ ├── ILEmit
│ │ ├── ILEmitCallSiteAnalysisResult.cs
│ │ ├── ILEmitCallSiteAnalyzer.cs
│ │ ├── ILEmitResolverBuilder.cs
│ │ ├── ILEmitResolverBuilderContext.cs
│ │ └── ILEmitServiceProviderEngine.cs
│ ├── IServiceProviderEngine.cs
│ ├── IServiceProviderEngineCallback.cs
│ ├── ResultCache.cs
│ ├── RuntimeServiceProviderEngine.cs
│ ├── ServiceCacheKey.cs
│ ├── ServiceCallSite.cs
│ ├── ServiceProviderCallSite.cs
│ ├── ServiceProviderEngine.cs
│ ├── ServiceProviderEngineScope.cs
│ ├── ServiceScopeFactoryCallSite.cs
│ ├── SingletonCallSite.cs
│ ├── StackGuard.cs
│ └── ThrowHelper.cs
├── ServiceProvider.cs
├── ServiceProviderMode.cs
└── ServiceProviderOptions.cs
├── CodeArts.Emit
├── AbstractTypeEmitter.cs
├── AstException.cs
├── AstExpression.cs
├── BinaryExpressionType.cs
├── CodeArts.Emit.csproj
├── ConstructorEmitter.cs
├── DynamicMethod.cs
├── EmitUtils.cs
├── Emitters
│ ├── ClassEmitter.cs
│ ├── FieldEmitter.cs
│ ├── MethodEmitter.cs
│ ├── NestedClassEmitter.cs
│ ├── ParameterEmitter.cs
│ └── PropertyEmitter.cs
├── Expressions
│ ├── ArrayAst.cs
│ ├── ArrayIndexAst.cs
│ ├── ArrayLengthAst.cs
│ ├── BinaryAst.cs
│ ├── BlockAst.cs
│ ├── CoalesceAst.cs
│ ├── ConditionAst.cs
│ ├── ConstantAst.cs
│ ├── ConvertAst.cs
│ ├── DefaultAst.cs
│ ├── FieldAst.cs
│ ├── IfThenAst.cs
│ ├── IfThenElseAst.cs
│ ├── InvocationAst.cs
│ ├── MemberAst.cs
│ ├── MethodCallAst.cs
│ ├── NewArrayAst.cs
│ ├── NewInstanceAst.cs
│ ├── ParameterAst.cs
│ ├── PropertyAst.cs
│ ├── ReturnAst.cs
│ ├── SwitchAst.cs
│ ├── ThrowAst.cs
│ ├── TryAst.cs
│ ├── TypeAsAst.cs
│ ├── TypeIsAst.cs
│ ├── UnaryAst.cs
│ └── VariableAst.cs
├── INamingScope.cs
├── Intercept.cs
├── InterceptAsync.cs
├── InterceptAttribute.cs
├── InterceptContext.cs
├── ModuleEmitter.cs
├── NamingScope.cs
├── NoninterceptAttribute.cs
├── TypeExtensions.cs
└── UnaryExpressionType.cs
├── CodeArts.Json
├── CodeArts.Json.csproj
├── JsonStartup.cs
└── Serialize
│ └── Json
│ └── DefaultJsonHelper.cs
├── CodeArts.Logging
├── CodeArts.Logging.csproj
├── LoggerExtentions.cs
└── LoggerManager.cs
├── CodeArts.MemoryCaching
├── CodeArts.MemoryCaching.csproj
├── MemoryCaching.cs
├── MemoryCachingProvider.cs
├── MemoryCachingStartup.cs
└── MemoryManager.cs
├── CodeArts.Middleware
├── CodeArts.Middleware.csproj
├── IProxyByPattern.cs
├── InterceptCore.cs
├── MethodInfoEqualityComparer.cs
├── MiddlewareIntercept.cs
├── MiddlewareInterceptAsync.cs
├── Proxies
│ ├── ProxyByFactory.cs
│ ├── ProxyByImplementationType.cs
│ ├── ProxyByInstance.cs
│ └── ProxyByServiceType.cs
├── ServicesExtensions.cs
└── TypeExtensions.cs
├── CodeArts.Mvc
├── Algorithms
│ └── HMACSHA256AlgorithmGen.cs
├── Authentication
│ ├── JwtBearerApplicationBuilderExtensions.cs
│ ├── JwtBearerEvents.cs
│ └── ResultContext.cs
├── BaseController.cs
├── Builder
│ ├── ApplicationBuilderExtensions.cs
│ └── IApplicationBuilder.cs
├── CodeArts.Mvc.csproj
├── Converters
│ └── MyJsonConverter.cs
├── DExceptionFilter.cs
├── DStartup.cs
├── DependencyInjectionOptions.cs
├── DependencyInjectionServiceCollectionExtentions.cs
├── DictionaryExtentions.cs
├── ExceptionAdapter.cs
├── ExceptionHandler.cs
├── Filters
│ └── ValidateModelAttribute.cs
├── Hosting
│ └── ApplicationStart.cs
├── HttpContextExtensions.cs
├── HttpVerbs.cs
├── IJwtAlgorithmGen.cs
├── JwtAlgorithmGen.cs
├── JwtStartup.cs
├── JwtToken.cs
├── JwtTokenGen.cs
├── LoggerManagerExtentions.cs
├── MapExtensions.cs
├── ModelValidator.cs
├── PathString.cs
├── Providers
│ ├── CachedDataAnnotationsModelMetadata.cs
│ ├── DataAnnotationsModelMetadataProvider.cs
│ └── DataAnnotationsModelValidator.cs
├── ResponseExtensions.cs
└── Validators
│ └── DataAnnotations
│ ├── DataAnnotationsModelValidator.cs
│ └── DataAnnotationsModelValidatorProvider.cs
├── CodeArts.Net
├── CodeArts.Net.csproj
├── Extentions
│ ├── EncodingExtentions.cs
│ └── UriExtentions.cs
├── IRequestable.cs
└── WebCoreClient.cs
├── CodeArts.RedisCaching
├── CodeArts.RedisCaching.csproj
├── RedisCaching.cs
├── RedisCachingProvider.cs
├── RedisCachingStartup.cs
└── RedisManager.cs
└── CodeArts
├── AssemblyFinder.cs
├── CodeArts.csproj
├── Collections
└── Generic
│ ├── IAsyncEnumerable.cs
│ ├── IAsyncEnumerator.cs
│ ├── IReadOnlyCollection.cs
│ ├── IReadOnlyDictionary.cs
│ └── IReadOnlyList.cs
├── Config
├── ConfigHelper.cs
└── IConfigHelper.cs
├── Consts.cs
├── Converter.cs
├── DResult.cs
├── DefaultSettings.cs
├── DevelopAttribute.cs
├── Emptyable.cs
├── Exceptions
├── BusiException.cs
├── CodeException.cs
├── ServException.cs
└── SyntaxException.cs
├── Extentions
├── CryptoExtentions.cs
├── EnumExtensions.cs
├── IEnumerableAsyncExtentions.cs
├── IEnumerableExtentions.cs
├── QueryableExtentions.cs
├── ReadOnlyCollectionExtentions.cs
├── StringExtentions.cs
└── TypeExtensions.cs
├── IConfigable.cs
├── IKeyGen.cs
├── IKeyGenFactory.cs
├── IMapper.cs
├── IResult.cs
├── IStartup.cs
├── IgnoreAttribute.cs
├── JsonSettings.cs
├── Key.cs
├── KeyGen.cs
├── KeyGenFactory.cs
├── LazyLoading.cs
├── Mapper.cs
├── NamingAttribute.cs
├── NamingType.cs
├── PagedList.cs
├── PatternKind.cs
├── Runtime
├── ConstructorItem.cs
├── FieldItem.cs
├── MethodItem.cs
├── ParameterItem.cs
├── PropertyItem.cs
├── StoreItem.cs
└── TypeItem.cs
├── RuntimeServPools.cs
├── Serialize
├── Json
│ ├── IJsonHelper.cs
│ └── JsonHelper.cs
└── Xml
│ └── XmlHelper.cs
├── ServResult.cs
├── Singleton.cs
├── SnowflakeFactory.cs
├── SnowflakeKeyGen.cs
├── StatusCodes.cs
├── StatusCodesExtentions.cs
├── Threading
├── AsyncLocal.cs
├── AsyncLocalValueChangedArgs.cs
└── CallContext.cs
├── UppercaseString.cs
└── XStartup.cs
/.editorconfig:
--------------------------------------------------------------------------------
1 | [*.cs]
2 |
3 | # IDE0066: 将 switch 语句转换为表达式
4 | dotnet_diagnostic.IDE0066.severity = none
5 |
6 | # IDE0063: 使用简单的 "using" 语句
7 | dotnet_diagnostic.IDE0063.severity = none
8 |
--------------------------------------------------------------------------------
/.github/ISSUE_REPLY_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug.
3 | about: The framework is abnormal.
4 | ---
5 |
6 | ## ISSUE TEMPLATE
7 |
8 | #### 实例:
9 |
10 | ```c
11 | // 异常代码。
12 | ```
13 |
14 | #### 说明:
15 |
16 | * 异常描述。
--------------------------------------------------------------------------------
/LICENSE.txt:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2019 Tiny Lit
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
--------------------------------------------------------------------------------
/Tests/CodeArts.Db.Dapper.Tests/CodeArts.Db.Dapper.Tests.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netcoreapp2.1;net461;
5 |
6 | false
7 |
8 |
9 |
10 | NETSTANDARD2_1;
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Tests/CodeArts.Db.Dapper.Tests/Serialize/SqlServerConnectionAttribute.cs:
--------------------------------------------------------------------------------
1 | using CodeArts.Db;
2 | using CodeArts.Db.Tests;
3 | using System;
4 |
5 | namespace UnitTest.Serialize
6 | {
7 | ///
8 | /// 数据库供应器。
9 | ///
10 | [AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface)]
11 | public class SqlServerConnectionAttribute : DbConfigAttribute
12 | {
13 | public override ConnectionConfig GetConfig()
14 | {
15 | return new ConnectionConfig
16 | {
17 | Name = "de",
18 | ProviderName = "SqlServer",
19 | ConnectionString = string.Format(@"Data Source={0};User ID={2}; Password={3};Initial Catalog={1};Pooling=true",
20 | SqlServerConsts.Domain,
21 | SqlServerConsts.Database,
22 | SqlServerConsts.User,
23 | SqlServerConsts.Password)//? 数据库链接
24 | };
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/Tests/CodeArts.Db.Dapper.Tests/SkyDbContext.cs:
--------------------------------------------------------------------------------
1 | using CodeArts.Db.Dapper.Tests.Domain.Entities;
2 | using UnitTest.Serialize;
3 |
4 | namespace CodeArts.Db.Dapper.Tests
5 | {
6 | [SqlServerConnection]
7 | public class SkyDbContext : DbContext
8 | {
9 | public DbServiceSet Users { get; set; }
10 |
11 | public DbServiceSet Userdetails { get; set; }
12 | }
13 | }
--------------------------------------------------------------------------------
/Tests/CodeArts.Db.Dapper.Tests/SqlServerConsts.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace CodeArts.Db.Tests
6 | {
7 | public class SqlServerConsts
8 | {
9 | internal static readonly string Domain = Environment.GetEnvironmentVariable("DEV-DATABASE-SQLSEVER-DOMAIN") ?? "sqlsever.server.com";
10 | internal static readonly string Database = Environment.GetEnvironmentVariable("DEV-DATABASE-SQLSEVER-DATABASE") ?? "yep_sky_orm";
11 | internal static readonly string User = Environment.GetEnvironmentVariable("DEV-DATABASE-SQLSEVER-USER") ?? "sa";
12 | internal static readonly string Password = Environment.GetEnvironmentVariable("DEV-DATABASE-SQLSEVER-PASSWORD") ?? "Password@12";
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/Tests/CodeArts.Db.EntityFramework.Tests/DbTestContext.cs:
--------------------------------------------------------------------------------
1 | #if NET461
2 | using System.Data.Entity;
3 | #else
4 | using Microsoft.EntityFrameworkCore;
5 | #endif
6 | using UnitTest.Domain.Entities;
7 | using UnitTest.Serialize;
8 |
9 | namespace CodeArts.Db.EntityFramework.Tests
10 | {
11 | [SqlServerConnection]
12 | public class DbTestContext : DbContext
13 | {
14 | public DbSet FeiUserdetails { get; set; }
15 |
16 | public DbSet FeiUsers { get; set; }
17 |
18 | public DbSet FeiUserWeChat { get; set; }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/Tests/CodeArts.Db.EntityFramework.Tests/Domain/UserDetailsRepository.cs:
--------------------------------------------------------------------------------
1 | using CodeArts.Db.EntityFramework;
2 | using UnitTest.Domain.Entities;
3 | using UnitTest.Serialize;
4 | #if NET461
5 | using System.Data.Entity;
6 | #else
7 | using Microsoft.EntityFrameworkCore;
8 | #endif
9 |
10 | namespace CodeArts.Db.Domain
11 | {
12 | [SqlServerConnection]
13 | public class UserDetailsRepository : LinqRepository
14 | {
15 | public UserDetailsRepository(DbContext context) : base(context)
16 | {
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/Tests/CodeArts.Db.EntityFramework.Tests/Domain/UserRepository.cs:
--------------------------------------------------------------------------------
1 | using CodeArts.Db.EntityFramework;
2 | #if NET461
3 | using System.Data.Entity;
4 | #else
5 | using Microsoft.EntityFrameworkCore;
6 | #endif
7 | using UnitTest.Domain.Entities;
8 | using UnitTest.Serialize;
9 |
10 | namespace CodeArts.Db.Domain
11 | {
12 | [SqlServerConnection]
13 | public class UserRepository : LinqRepository
14 | {
15 | public UserRepository(DbContext context) : base(context)
16 | {
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/Tests/CodeArts.Db.EntityFramework.Tests/Domain/UserWeChatRepository.cs:
--------------------------------------------------------------------------------
1 | using CodeArts.Db.EntityFramework;
2 | using UnitTest.Domain.Entities;
3 | using UnitTest.Serialize;
4 | #if NET461
5 | using System.Data.Entity;
6 | #else
7 | using Microsoft.EntityFrameworkCore;
8 | #endif
9 |
10 | namespace CodeArts.Db.Domain
11 | {
12 | [SqlServerConnection]
13 | public class UserWeChatRepository : LinqRepository
14 | {
15 | public UserWeChatRepository(DbContext context) : base(context)
16 | {
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/Tests/CodeArts.Db.EntityFramework.Tests/Dtos/TaxCodeTreeSimDto.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace UnitTest.Dtos
6 | {
7 | ///
8 | /// 税务编码树结构出参。
9 | ///
10 | public class TaxCodeTreeSimDto
11 | {
12 | ///
13 | /// ID。
14 | ///
15 | public string Id { get; set; }
16 |
17 | ///
18 | /// 名称。
19 | ///
20 | public string Name { get; set; }
21 |
22 | ///
23 | /// 简称。
24 | ///
25 | public string ShortName { get; set; }
26 |
27 | ///
28 | /// 是否包含孩子节点。
29 | ///
30 | public bool HasChild { get; set; }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/Tests/CodeArts.Db.EntityFramework.Tests/Dtos/UserSimDto.cs:
--------------------------------------------------------------------------------
1 | namespace UnitTest.Dtos
2 | {
3 | ///
4 | /// 用户简表。
5 | ///
6 | public class UserSimDto
7 | {
8 | ///
9 | /// ID。
10 | ///
11 | public int Id { get; set; }
12 | ///
13 | /// 用户名称。
14 | ///
15 | public string Username { get; set; }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Tests/CodeArts.Db.EntityFramework.Tests/Enums/AuthShipEnum.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel;
2 |
3 | namespace UnitTest.Enums
4 | {
5 | ///
6 | /// 权限关系类型。
7 | ///
8 | public enum AuthShipEnum
9 | {
10 | ///
11 | /// 人员权限。
12 | ///
13 | [Description("人员权限")]
14 | User = 1 << 0,
15 | ///
16 | /// 机构权限。
17 | ///
18 | [Description("机构权限")]
19 | Tree = 1 << 1,
20 | ///
21 | /// 付费权限。
22 | ///
23 | [Description("付费权限")]
24 | Vip = 1 << 2
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/Tests/CodeArts.Db.EntityFramework.Tests/Enums/AuthTreeEnum.cs:
--------------------------------------------------------------------------------
1 | namespace UnitTest.Enums
2 | {
3 | ///
4 | /// 权限类型。
5 | ///
6 | public enum AuthTreeEnum
7 | {
8 | ///
9 | /// 项目。
10 | ///
11 | Project = 1 << 0,
12 | ///
13 | /// 导航。
14 | ///
15 | Nav = 1 << 1,
16 | ///
17 | /// 菜单。
18 | ///
19 | Menu = 1 << 2,
20 | ///
21 | /// 页面。
22 | ///
23 | Page = 1 << 3,
24 | ///
25 | /// 功能。
26 | ///
27 | Function = 1 << 4,
28 | ///
29 | /// 面板。
30 | ///
31 | Panel = 1 << 5,
32 | ///
33 | /// 提示。
34 | ///
35 | Alert = 1 << 6,
36 | ///
37 | /// 标记。
38 | ///
39 | Label = 1 << 7
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/Tests/CodeArts.Db.EntityFramework.Tests/Enums/CommonStatusEnum.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel;
2 |
3 | namespace UnitTest.Enums
4 | {
5 | ///
6 | /// 公共状态枚举。
7 | ///
8 | public enum CommonStatusEnum
9 | {
10 | ///
11 | /// 删除。
12 | ///
13 | [Description("已删除")]
14 | Deleted = -1,
15 | ///
16 | /// 未激活。
17 | ///
18 | [Description("未激活")]
19 | NonActivated = 0,
20 | ///
21 | /// 启用。
22 | ///
23 | [Description("启用")]
24 | Enabled = 1,
25 | ///
26 | /// 禁用。
27 | ///
28 | [Description("禁用")]
29 | Disabled = 2
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/Tests/CodeArts.Db.EntityFramework.Tests/Enums/OrgTreeEnum.cs:
--------------------------------------------------------------------------------
1 | namespace UnitTest.Enums
2 | {
3 | ///
4 | /// 机构类型。
5 | ///
6 | public enum OrgTreeEnum
7 | {
8 | ///
9 | /// 集团。
10 | ///
11 | G = 1 << 0,
12 | ///
13 | /// 单位。
14 | ///
15 | N = 1 << 1,
16 | ///
17 | /// 部门。
18 | ///
19 | M = 1 << 2,
20 | ///
21 | /// 商铺。
22 | ///
23 | S = 1 << 3,
24 | ///
25 | /// 虚拟节点。
26 | ///
27 | V = 1 << 4
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/Tests/CodeArts.Db.EntityFramework.Tests/Enums/UserRole.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel;
2 |
3 | namespace UnitTest.Enums
4 | {
5 | ///
6 | /// 用户角色。
7 | ///
8 | public enum UserRole
9 | {
10 | #region 客户
11 | ///
12 | /// 用户。
13 | ///
14 | [Description("用户")]
15 | Normal = 1 << 0,
16 | ///
17 | /// 管理员。
18 | ///
19 | [Description("管理员")]
20 | Administrator = 1 << 1,
21 | #endregion
22 |
23 | #region 系统
24 | ///
25 | /// 销售人员。
26 | ///
27 | [Description("销售人")]
28 | Saler = 1 << 2,
29 | ///
30 | /// 开发者。
31 | ///
32 | [Description("开发者")]
33 | Developer = 1 << 3,
34 | ///
35 | /// 维护人。
36 | ///
37 | [Description("维护人")]
38 | Maintainer = 1 << 4,
39 | ///
40 | /// 拥有者。
41 | ///
42 | [Description("拥有者")]
43 | Owner = 1 << 5
44 | #endregion
45 |
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/Tests/CodeArts.Db.EntityFramework.Tests/Enums/UserSex.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel;
2 |
3 | namespace UnitTest.Enums
4 | {
5 | ///
6 | /// 用户性别。
7 | ///
8 | public enum UserSex
9 | {
10 | ///
11 | /// 未知。
12 | ///
13 | [Description("未知")]
14 | Unkown = 0,
15 | ///
16 | /// 男。
17 | ///
18 | [Description("男")]
19 | Male = 1 << 1,
20 | ///
21 | /// 女。
22 | ///
23 | [Description("女")]
24 | Female = 1 << 2,
25 | ///
26 | /// 中性。
27 | ///
28 | [Description("中性")]
29 | Neutral = 1 << 3
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/Tests/CodeArts.Db.EntityFramework.Tests/Serialize/DefaultDbConfigAttribute.cs:
--------------------------------------------------------------------------------
1 | using CodeArts.Db;
2 | using System;
3 |
4 | namespace UnitTest.Serialize
5 | {
6 | ///
7 | /// 默认数据库。
8 | ///
9 | [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
10 | public class DefaultDbConfigAttribute : DbConfigAttribute
11 | {
12 | ///
13 | /// 获取链接配置。
14 | ///
15 | ///
16 | public override ConnectionConfig GetConfig()
17 | {
18 | return new ConnectionConfig
19 | {
20 | Name = "yep.v3.auth",
21 | ProviderName = "MySql",
22 | ConnectionString = "server=127.0.0.1;port=3306;user=root;password=Password12!;database=mysql;"//? 数据库链接
23 | };
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/Tests/CodeArts.Db.EntityFramework.Tests/Serialize/SqlServerConnectionAttribute.cs:
--------------------------------------------------------------------------------
1 | using CodeArts.Db;
2 | using CodeArts.Db.Tests;
3 | using System;
4 |
5 | namespace UnitTest.Serialize
6 | {
7 | ///
8 | /// 数据库供应器。
9 | ///
10 | [AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface)]
11 | public class SqlServerConnectionAttribute : DbConfigAttribute
12 | {
13 | public override ConnectionConfig GetConfig()
14 | {
15 | return new ConnectionConfig
16 | {
17 | Name = "de",
18 | ProviderName = "SqlServer",
19 | ConnectionString = string.Format(@"Data Source={0};User ID={2}; Password={3};Initial Catalog={1};Pooling=true",
20 | SqlServerConsts.Domain,
21 | SqlServerConsts.Database,
22 | SqlServerConsts.User,
23 | SqlServerConsts.Password)//? 数据库链接
24 | };
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/Tests/CodeArts.Db.EntityFramework.Tests/SqlServerConsts.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace CodeArts.Db.Tests
6 | {
7 | public class SqlServerConsts
8 | {
9 | internal static readonly string Domain = Environment.GetEnvironmentVariable("DEV-DATABASE-SQLSEVER-DOMAIN") ?? "sqlsever.server.com";
10 | internal static readonly string Database = Environment.GetEnvironmentVariable("DEV-DATABASE-SQLSEVER-DATABASE") ?? "yep_sky_orm";
11 | internal static readonly string User = Environment.GetEnvironmentVariable("DEV-DATABASE-SQLSEVER-USER") ?? "sa";
12 | internal static readonly string Password = Environment.GetEnvironmentVariable("DEV-DATABASE-SQLSEVER-PASSWORD") ?? "Password@12";
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/Tests/CodeArts.Db.EntityFramework.Tests/SqlServerTest.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tinylit/codearts/5002d35735f4dc5318737bca346f261af199dc3b/Tests/CodeArts.Db.EntityFramework.Tests/SqlServerTest.cs
--------------------------------------------------------------------------------
/Tests/CodeArts.Db.EntityFramework.Tests/UnitTest1.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.TestTools.UnitTesting;
2 |
3 | namespace CodeArts.Db.EntityFramework.Tests
4 | {
5 | [TestClass]
6 | public class Tests
7 | {
8 | [TestInitialize]
9 | public void Setup()
10 | {
11 | }
12 |
13 | [TestMethod]
14 | public void Test1()
15 | {
16 |
17 | }
18 | }
19 | }
--------------------------------------------------------------------------------
/Tests/CodeArts.Db.Lts.Tests/CodeArts.Db.Lts.Tests.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netcoreapp2.1;net461;
5 |
6 | false
7 |
8 |
9 |
10 | NETSTANDARD2_1;
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/Tests/CodeArts.Db.Lts.Tests/Domain/AuthShipRepository.cs:
--------------------------------------------------------------------------------
1 | using CodeArts.Db.Lts;
2 | using UnitTest.Domain.Entities;
3 | using UnitTest.Serialize;
4 |
5 | namespace UnitTest.Domain
6 | {
7 | [DefaultDbConfig]
8 | public class AuthShipRepository : DbRepository
9 | {
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/Tests/CodeArts.Db.Lts.Tests/Domain/AuthTreeRepository.cs:
--------------------------------------------------------------------------------
1 | using CodeArts.Db.Lts;
2 | using UnitTest.Domain.Entities;
3 | using UnitTest.Serialize;
4 |
5 | namespace UnitTest.Domain
6 | {
7 | [DefaultDbConfig]
8 | public class AuthTreeRepository : DbRepository
9 | {
10 |
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Tests/CodeArts.Db.Lts.Tests/Domain/Entities/OrmTest.cs:
--------------------------------------------------------------------------------
1 | using CodeArts.Db.Tests.Serialize;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Text;
5 |
6 | namespace CodeArts.Db.Tests.Domain.Entities
7 | {
8 | ///
9 | /// ORM性能测试。
10 | ///
11 | [Naming("yep_orm_test", NamingType.UrlCase)]
12 | public class OrmTest : BaseEntity
13 | {
14 | ///
15 | /// 名称。
16 | ///
17 | public string Name { get; set; } = string.Empty;
18 |
19 | ///
20 | /// 状态。
21 | ///
22 | public int Status { get; set; }
23 |
24 | ///
25 | /// 创建日期。
26 | ///
27 | public DateTime Created { get; set; } = DateTime.Now;
28 |
29 | ///
30 | /// 修改日期。
31 | ///
32 | [DateTimeToken]
33 | public DateTime Modified { get; set; } = DateTime.Now;
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/Tests/CodeArts.Db.Lts.Tests/Domain/MySqlUserRespository.cs:
--------------------------------------------------------------------------------
1 | using CodeArts.Db.Lts;
2 | using UnitTest.Domain.Entities;
3 | using UnitTest.Serialize;
4 |
5 | namespace UnitTest.Domain
6 | {
7 | [DefaultDbConfig]
8 | public class MySqlUserRespository : DbRepository
9 | {
10 |
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Tests/CodeArts.Db.Lts.Tests/Domain/OrgTreeRepository.cs:
--------------------------------------------------------------------------------
1 | using CodeArts.Db.Lts;
2 | using UnitTest.Domain.Entities;
3 | using UnitTest.Serialize;
4 |
5 | namespace UnitTest.Domain
6 | {
7 | [DefaultDbConfig]
8 | public class OrgTreeRepository : DbRepository
9 | {
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/Tests/CodeArts.Db.Lts.Tests/Domain/OrmTestRepository.cs:
--------------------------------------------------------------------------------
1 | using CodeArts.Db.Lts;
2 | using CodeArts.Db.Tests.Domain.Entities;
3 | using UnitTest.Serialize;
4 |
5 | namespace CodeArts.Db.Tests.Domain
6 | {
7 | [DefaultDbConfig]
8 | public class OrmTestRepository : DbRepository
9 | {
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/Tests/CodeArts.Db.Lts.Tests/Domain/TaxCodeRepository.cs:
--------------------------------------------------------------------------------
1 | using CodeArts.Db;
2 | using CodeArts.Db.Lts;
3 | using CodeArts.Db.Lts.Tests;
4 | using UnitTest.Domain.Entities;
5 |
6 | namespace UnitTest.Domain
7 | {
8 | ///
9 | /// 发票仓库。
10 | ///
11 | public class TaxCodeRepository : DbRepository
12 | {
13 | protected override IReadOnlyConnectionConfig GetDbConfig()
14 | {
15 | return new ConnectionConfig
16 | {
17 | Name = "yep.v3.invoice",
18 | ProviderName = "MySql",
19 | ConnectionString = string.Format("server={0};port=3306;user={2};password={3};database={1};"
20 | , MySqlConsts.Domain
21 | , MySqlConsts.Database
22 | , MySqlConsts.User
23 | , MySqlConsts.Password)//? 数据库链接
24 | };
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/Tests/CodeArts.Db.Lts.Tests/Domain/UserDetailsRepository.cs:
--------------------------------------------------------------------------------
1 | using CodeArts.Db.Lts;
2 | using UnitTest.Domain.Entities;
3 | using UnitTest.Serialize;
4 |
5 | namespace CodeArts.Db.Domain
6 | {
7 | [SqlServerConnection]
8 | public class UserDetailsRepository : Repository
9 | {
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/Tests/CodeArts.Db.Lts.Tests/Domain/UserRepository.cs:
--------------------------------------------------------------------------------
1 | using CodeArts.Db.Lts;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using UnitTest.Domain.Entities;
5 | using UnitTest.Serialize;
6 |
7 | namespace CodeArts.Db.Domain
8 | {
9 | [SqlServerConnection]
10 | public class UserRepository : DbRepository
11 | {
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Tests/CodeArts.Db.Lts.Tests/Domain/UserWeChatRepository.cs:
--------------------------------------------------------------------------------
1 | using CodeArts.Db.Lts;
2 | using UnitTest.Domain.Entities;
3 | using UnitTest.Serialize;
4 |
5 | namespace CodeArts.Db.Domain
6 | {
7 | [SqlServerConnection]
8 | public class UserWeChatRepository : DbRepository
9 | {
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/Tests/CodeArts.Db.Lts.Tests/Dtos/TaxCodeTreeSimDto.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace UnitTest.Dtos
6 | {
7 | ///
8 | /// 税务编码树结构出参。
9 | ///
10 | public class TaxCodeTreeSimDto
11 | {
12 | ///
13 | /// ID。
14 | ///
15 | public string Id { get; set; }
16 |
17 | ///
18 | /// 名称。
19 | ///
20 | public string Name { get; set; }
21 |
22 | ///
23 | /// 简称。
24 | ///
25 | public string ShortName { get; set; }
26 |
27 | ///
28 | /// 是否包含孩子节点。
29 | ///
30 | public bool HasChild { get; set; }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/Tests/CodeArts.Db.Lts.Tests/Dtos/UserSimDto.cs:
--------------------------------------------------------------------------------
1 | namespace UnitTest.Dtos
2 | {
3 | ///
4 | /// 用户简表。
5 | ///
6 | public class UserSimDto
7 | {
8 | ///
9 | /// ID。
10 | ///
11 | public int Id { get; set; }
12 | ///
13 | /// 用户名称。
14 | ///
15 | public string Username { get; set; }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Tests/CodeArts.Db.Lts.Tests/Enums/AuthShipEnum.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel;
2 |
3 | namespace UnitTest.Enums
4 | {
5 | ///
6 | /// 权限关系类型。
7 | ///
8 | public enum AuthShipEnum
9 | {
10 | ///
11 | /// 人员权限。
12 | ///
13 | [Description("人员权限")]
14 | User = 1 << 0,
15 | ///
16 | /// 机构权限。
17 | ///
18 | [Description("机构权限")]
19 | Tree = 1 << 1,
20 | ///
21 | /// 付费权限。
22 | ///
23 | [Description("付费权限")]
24 | Vip = 1 << 2
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/Tests/CodeArts.Db.Lts.Tests/Enums/AuthTreeEnum.cs:
--------------------------------------------------------------------------------
1 | namespace UnitTest.Enums
2 | {
3 | ///
4 | /// 权限类型。
5 | ///
6 | public enum AuthTreeEnum
7 | {
8 | ///
9 | /// 项目。
10 | ///
11 | Project = 1 << 0,
12 | ///
13 | /// 导航。
14 | ///
15 | Nav = 1 << 1,
16 | ///
17 | /// 菜单。
18 | ///
19 | Menu = 1 << 2,
20 | ///
21 | /// 页面。
22 | ///
23 | Page = 1 << 3,
24 | ///
25 | /// 功能。
26 | ///
27 | Function = 1 << 4,
28 | ///
29 | /// 面板。
30 | ///
31 | Panel = 1 << 5,
32 | ///
33 | /// 提示。
34 | ///
35 | Alert = 1 << 6,
36 | ///
37 | /// 标记。
38 | ///
39 | Label = 1 << 7
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/Tests/CodeArts.Db.Lts.Tests/Enums/CommonStatusEnum.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel;
2 |
3 | namespace UnitTest.Enums
4 | {
5 | ///
6 | /// 公共状态枚举。
7 | ///
8 | public enum CommonStatusEnum
9 | {
10 | ///
11 | /// 删除。
12 | ///
13 | [Description("已删除")]
14 | Deleted = -1,
15 | ///
16 | /// 未激活。
17 | ///
18 | [Description("未激活")]
19 | NonActivated = 0,
20 | ///
21 | /// 启用。
22 | ///
23 | [Description("启用")]
24 | Enabled = 1,
25 | ///
26 | /// 禁用。
27 | ///
28 | [Description("禁用")]
29 | Disabled = 2
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/Tests/CodeArts.Db.Lts.Tests/Enums/OrgTreeEnum.cs:
--------------------------------------------------------------------------------
1 | namespace UnitTest.Enums
2 | {
3 | ///
4 | /// 机构类型。
5 | ///
6 | public enum OrgTreeEnum
7 | {
8 | ///
9 | /// 集团。
10 | ///
11 | G = 1 << 0,
12 | ///
13 | /// 单位。
14 | ///
15 | N = 1 << 1,
16 | ///
17 | /// 部门。
18 | ///
19 | M = 1 << 2,
20 | ///
21 | /// 商铺。
22 | ///
23 | S = 1 << 3,
24 | ///
25 | /// 虚拟节点。
26 | ///
27 | V = 1 << 4
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/Tests/CodeArts.Db.Lts.Tests/Enums/OssAclEnum.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel;
2 |
3 | namespace UnitTest.Enums
4 | {
5 | ///
6 | /// OSS 读写权限。
7 | ///
8 | public enum OssAclEnum
9 | {
10 | ///
11 | /// 私有。
12 | ///
13 | [Description("私有")]
14 | Private,
15 |
16 | ///
17 | /// 公共读。
18 | ///
19 | [Description("公共读")]
20 | PublicRead,
21 |
22 | ///
23 | /// 公共读写。
24 | ///
25 | [Description("公共读写")]
26 | PublicReadWrite
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/Tests/CodeArts.Db.Lts.Tests/Enums/OssAlgorithmEnum.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel;
2 |
3 | namespace UnitTest.Enums
4 | {
5 | ///
6 | /// OSS 加密方式。
7 | ///
8 | public enum OssAlgorithmEnum
9 | {
10 | ///
11 | /// 无。
12 | ///
13 | [Description("无")]
14 | None,
15 |
16 | ///
17 | /// OSS 完全托管。
18 | ///
19 | [Description("OSS完全托管")]
20 | OssProxy,
21 |
22 | ///
23 | /// KMS。
24 | ///
25 | [Description("KMS")]
26 | KMS
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/Tests/CodeArts.Db.Lts.Tests/Enums/OssKmsEncryptionAlgorithmEnum.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel;
2 |
3 | namespace UnitTest.Enums
4 | {
5 | ///
6 | /// OSS 加密算法。
7 | ///
8 | public enum OssKmsEncryptionAlgorithmEnum
9 | {
10 | ///
11 | /// 无。
12 | ///
13 | [Description("无")]
14 | None,
15 | ///
16 | /// AES256。
17 | ///
18 | [Description("AES256")]
19 | AES256,
20 |
21 | ///
22 | /// SM4。
23 | ///
24 | [Description("SM4")]
25 | SM4
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/Tests/CodeArts.Db.Lts.Tests/Enums/OssStorageEnum.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel;
2 |
3 | namespace UnitTest.Enums
4 | {
5 | ///
6 | /// OSS 存储类型。
7 | ///
8 | public enum OssStorageEnum
9 | {
10 | ///
11 | /// 标准。
12 | ///
13 | [Description("标准")]
14 | Standard,
15 |
16 | ///
17 | /// 低频访问。
18 | ///
19 | [Description("低频访问")]
20 | LowAccess,
21 |
22 | ///
23 | /// 归档。
24 | ///
25 | [Description("归档")]
26 | Archived
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/Tests/CodeArts.Db.Lts.Tests/Enums/UserRole.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel;
2 |
3 | namespace UnitTest.Enums
4 | {
5 | ///
6 | /// 用户角色。
7 | ///
8 | public enum UserRole
9 | {
10 | #region 客户
11 | ///
12 | /// 用户。
13 | ///
14 | [Description("用户")]
15 | Normal = 1 << 0,
16 | ///
17 | /// 管理员。
18 | ///
19 | [Description("管理员")]
20 | Administrator = 1 << 1,
21 | #endregion
22 |
23 | #region 系统
24 | ///
25 | /// 销售人员。
26 | ///
27 | [Description("销售人")]
28 | Saler = 1 << 2,
29 | ///
30 | /// 开发者。
31 | ///
32 | [Description("开发者")]
33 | Developer = 1 << 3,
34 | ///
35 | /// 维护人。
36 | ///
37 | [Description("维护人")]
38 | Maintainer = 1 << 4,
39 | ///
40 | /// 拥有者。
41 | ///
42 | [Description("拥有者")]
43 | Owner = 1 << 5
44 | #endregion
45 |
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/Tests/CodeArts.Db.Lts.Tests/Enums/UserSex.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel;
2 |
3 | namespace UnitTest.Enums
4 | {
5 | ///
6 | /// 用户性别。
7 | ///
8 | public enum UserSex
9 | {
10 | ///
11 | /// 未知。
12 | ///
13 | [Description("未知")]
14 | Unkown = 0,
15 | ///
16 | /// 男。
17 | ///
18 | [Description("男")]
19 | Male = 1 << 1,
20 | ///
21 | /// 女。
22 | ///
23 | [Description("女")]
24 | Female = 1 << 2,
25 | ///
26 | /// 中性。
27 | ///
28 | [Description("中性")]
29 | Neutral = 1 << 3
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/Tests/CodeArts.Db.Lts.Tests/MySqlConsts.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace CodeArts.Db.Lts.Tests
6 | {
7 | public class MySqlConsts
8 | {
9 | internal static readonly string Domain = Environment.GetEnvironmentVariable("DEV-DATABASE-MYSQL-DOMAIN") ?? "mysql.server.com";
10 | internal static readonly string Database = Environment.GetEnvironmentVariable("DEV-DATABASE-MYSQL-DATABASE") ?? "yep_sky_orm";
11 | internal static readonly string User = Environment.GetEnvironmentVariable("DEV-DATABASE-MYSQL-USER") ?? "root";
12 | internal static readonly string Password = Environment.GetEnvironmentVariable("DEV-DATABASE-MYSQL-PASSWORD") ?? "Password!12";
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/Tests/CodeArts.Db.Lts.Tests/Serialize/DateTimeTokenAttribute.cs:
--------------------------------------------------------------------------------
1 | using CodeArts.Db.Lts;
2 | using System;
3 |
4 | namespace CodeArts.Db.Tests.Serialize
5 | {
6 | ///
7 | /// 日期令牌。
8 | ///
9 | [AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = false)]
10 | public class DateTimeTokenAttribute : TokenAttribute
11 | {
12 | public override object Create() => DateTime.Now;
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/Tests/CodeArts.Db.Lts.Tests/Serialize/DefaultDbConfigAttribute.cs:
--------------------------------------------------------------------------------
1 | using CodeArts.Db;
2 | using CodeArts.Db.Lts.Tests;
3 | using System;
4 |
5 | namespace UnitTest.Serialize
6 | {
7 | ///
8 | /// 默认数据库。
9 | ///
10 | [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
11 | public class DefaultDbConfigAttribute : DbConfigAttribute
12 | {
13 | ///
14 | /// 获取链接配置。
15 | ///
16 | ///
17 | public override ConnectionConfig GetConfig()
18 | {
19 | return new ConnectionConfig
20 | {
21 | Name = "yep.v3.auth",
22 | ProviderName = "MySql",
23 | ConnectionString = string.Format("server={0};port=3306;user={2};password={3};database={1};"
24 | , MySqlConsts.Domain
25 | , MySqlConsts.Database
26 | , MySqlConsts.User
27 | , MySqlConsts.Password)//? 数据库链接
28 | };
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/Tests/CodeArts.Db.Lts.Tests/Serialize/SqlServerConnectionAttribute.cs:
--------------------------------------------------------------------------------
1 | using CodeArts.Db;
2 | using CodeArts.Db.Tests;
3 | using System;
4 |
5 | namespace UnitTest.Serialize
6 | {
7 | ///
8 | /// 数据库供应器。
9 | ///
10 | [AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface)]
11 | public class SqlServerConnectionAttribute : DbConfigAttribute
12 | {
13 | public override ConnectionConfig GetConfig()
14 | {
15 | return new ConnectionConfig
16 | {
17 | Name = "de",
18 | ProviderName = "SqlServer",
19 | ConnectionString = string.Format(@"Data Source={0};User ID={2}; Password={3};Initial Catalog={1};Pooling=true",
20 | SqlServerConsts.Domain,
21 | SqlServerConsts.Database,
22 | SqlServerConsts.User,
23 | SqlServerConsts.Password)//? 数据库链接
24 | };
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/Tests/CodeArts.Db.Lts.Tests/SqlServerConsts.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace CodeArts.Db.Tests
6 | {
7 | public class SqlServerConsts
8 | {
9 | internal static readonly string Domain = Environment.GetEnvironmentVariable("DEV-DATABASE-SQLSEVER-DOMAIN") ?? "sqlsever.server.com";
10 | internal static readonly string Database = Environment.GetEnvironmentVariable("DEV-DATABASE-SQLSEVER-DATABASE") ?? "yep_sky_orm";
11 | internal static readonly string User = Environment.GetEnvironmentVariable("DEV-DATABASE-SQLSEVER-USER") ?? "sa";
12 | internal static readonly string Password = Environment.GetEnvironmentVariable("DEV-DATABASE-SQLSEVER-PASSWORD") ?? "Password@12";
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/Tests/CodeArts.Db.Lts.Tests/SqlServerTest.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tinylit/codearts/5002d35735f4dc5318737bca346f261af199dc3b/Tests/CodeArts.Db.Lts.Tests/SqlServerTest.cs
--------------------------------------------------------------------------------
/Tests/CodeArts.Db.Lts.Tests/UnitTest1.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.TestTools.UnitTesting;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using UnitTest.Domain.Entities;
5 |
6 | namespace CodeArts.Db.Tests
7 | {
8 | [TestClass]
9 | public class UnitTest1
10 | {
11 | [TestMethod]
12 | public void TestMethod1()
13 | {
14 | var users = new List();
15 |
16 | var user = users.DefaultIfEmpty(null).First();
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/Tests/CodeArts.Emit.Tests/UnitTest1.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tinylit/codearts/5002d35735f4dc5318737bca346f261af199dc3b/Tests/CodeArts.Emit.Tests/UnitTest1.cs
--------------------------------------------------------------------------------
/Tests/CodeArts.Tests/CodeArts.Tests.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netcoreapp2.1;net461;
5 |
6 | false
7 |
8 |
9 |
10 | Json.NET .NET Standard 2.1
11 | NETSTANDARD2_1;
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/Tests/CodeArts.Tests/CryptoExtentions.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.TestTools.UnitTesting;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.IO;
5 | using System.Security.Cryptography;
6 | using System.Text;
7 |
8 | namespace CodeArts.Tests
9 | {
10 | [TestClass]
11 | public class CryptoExtentions
12 | {
13 | [TestMethod]
14 | public void MyTestMethod()
15 | {
16 | var value = "d;ljvhhgortpghfgbfgbgbg";
17 |
18 | var encrypt = value.Encrypt("@%d^#41&", "%@D^d$2~");
19 |
20 | var decrypt = encrypt.Decrypt("@%d^#41&", "%@D^d$2~");
21 |
22 | Assert.IsTrue(value == decrypt);
23 | }
24 |
25 | [TestMethod]
26 | public void MyTestMethod2()
27 | {
28 | var value = "d;ljvhhgortpghfgbfgbgbg";
29 |
30 | var encrypt = value.Encrypt("92N0La5}AC$@efgt", CryptoKind.AES);
31 |
32 | var decrypt = encrypt.Decrypt("92N0La5}AC$@efgt", CryptoKind.AES);
33 |
34 | Assert.IsTrue(value == decrypt);
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/Tests/CodeArts.Tests/EnumExtensions.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.TestTools.UnitTesting;
2 | using CodeArts.Tests.Enums;
3 | using System;
4 |
5 | namespace CodeArts.Tests
6 | {
7 | [TestClass]
8 | public class EnumExtensions
9 | {
10 | [TestMethod]
11 | public void GetText()
12 | {
13 | var text = DateTimeKind.Local.GetText();
14 |
15 | var text2 = RoleEnum.Admin.GetText();
16 | }
17 |
18 | [TestMethod]
19 | public void GetTextFlags()
20 | {
21 | var @enum = RoleFlagsEnum.User | RoleFlagsEnum.Admin;
22 |
23 | var text = @enum.GetText();
24 | }
25 |
26 | [TestMethod]
27 | public void ToValueString()
28 | {
29 | var text = RoleEnum.User.ToValueString();
30 |
31 | var text2 = RoleEnum.Admin.ToValueString();
32 | }
33 |
34 | [TestMethod]
35 | public void ToValueStringFlags()
36 | {
37 | var @enum = RoleFlagsEnum.User | RoleFlagsEnum.Admin;
38 |
39 | var text = @enum.ToValueString();
40 | }
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/Tests/CodeArts.Tests/Enums/RoleEnum.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Text;
5 |
6 | namespace CodeArts.Tests.Enums
7 | {
8 | public enum RoleEnum
9 | {
10 | User,
11 | [Description("管理员")]
12 | Admin
13 | }
14 |
15 | [Flags]
16 | public enum RoleFlagsEnum
17 | {
18 | User = 1 << 0,
19 | [Description("管理员")]
20 | Admin = 1 << 1
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/Tests/CodeArts.Tests/StringExtentions.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Text;
3 | using System.Text.RegularExpressions;
4 | using Microsoft.VisualStudio.TestTools.UnitTesting;
5 |
6 | namespace CodeArts.Tests
7 | {
8 |
9 | [TestClass]
10 | public class StringExtentions
11 | {
12 | [TestMethod]
13 | public void PropSugar()
14 | {
15 | for (int i = 0; i < 100000; i++)
16 | {
17 | string value = $"{i}x{{z + 100}}xx{{x ?? z + y}}-{{y?+z}}-{{z}}--{{xyz+sb}}-{{sb}}-{{abc}}".PropSugar(new { x = DateTimeKind.Utc, y = DateTime.Now, z = (string)null, xyz = new int[] { 1, 2, 3 }, sb = new StringBuilder("sb") }, new JsonSettings(NamingType.Normal));
18 | }
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Tests/CodeArts.Tests/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Tests/ConsoleEmit/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Tests/ConsoleEmit/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // 有关程序集的一般信息由以下
6 | // 控制。更改这些特性值可修改
7 | // 与程序集关联的信息。
8 | [assembly: AssemblyTitle("ConsoleEmit")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("ConsoleEmit")]
13 | [assembly: AssemblyCopyright("Copyright © 2019")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // 将 ComVisible 设置为 false 会使此程序集中的类型
18 | //对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
19 | //请将此类型的 ComVisible 特性设置为 true。
20 | [assembly: ComVisible(false)]
21 |
22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
23 | [assembly: Guid("5b3dedb3-f7c6-4b67-8da0-05bc3e12d785")]
24 |
25 | // 程序集的版本信息由下列四个值组成:
26 | //
27 | // 主版本
28 | // 次版本
29 | // 生成号
30 | // 修订号
31 | //
32 | //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
33 | //通过使用 "*",如下所示:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/Tests/GrpcClient/GrpcClient.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netcoreapp3.1
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/Tests/GrpcClient/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Linq;
5 | using System.Threading.Tasks;
6 | using Grpc.Net.Client;
7 | using Microsoft.AspNetCore.Hosting;
8 | using Microsoft.Extensions.Hosting;
9 |
10 | namespace GrpcClient
11 | {
12 | public class Program
13 | {
14 | static async Task Main()
15 | {
16 | // The port number(5001) must match the port of the gRPC server.
17 | var channel = GrpcChannel.ForAddress("https://localhost:44327/");
18 | var client = new Push.PushClient(channel);
19 | var reply = await client.PushAsync(new PushRequest
20 | {
21 | CompanyId = 109090080uL,
22 | InvoiceCode = "sdfg",
23 | InvoiceNo = "efoehgirht",
24 | InvoiceType = PushRequest.Types.InvoiceType.Electric,
25 | Jshj = "1000.11",
26 | Kprq = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
27 | Pdf = "dffgggh",
28 | RequestId = "dsdfdf",
29 | Ticket = PushRequest.Types.Ticket.Blue
30 | });
31 | Console.WriteLine("Greeting: " + reply.Code);
32 | Console.WriteLine("Press any key to exit...");
33 | Console.ReadKey();
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/Tests/GrpcClient/Protos/push.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | option csharp_namespace = "GrpcClient";
4 |
5 | package main;
6 |
7 | // The greeting service definition.
8 | service Push {
9 | // Sends a greeting
10 | rpc Push (PushRequest) returns (PushResult);
11 | }
12 |
13 | // The request message containing the user's name.
14 | message PushRequest {
15 | uint64 companyId = 1;
16 | string requestId = 2;
17 | enum InvoiceType {
18 | ELECTRIC = 0;
19 | NORMAL = 1;
20 | SPECIAL = 2;
21 | ROLL = 3;
22 | }
23 | InvoiceType invoiceType = 3;
24 | string invoiceCode = 4;
25 | string invoiceNo = 5;
26 | string jshj = 6;
27 | enum Ticket{
28 | BLUE = 0;
29 | RED = 1;
30 | }
31 | Ticket ticket = 7;
32 | string pdf = 8;
33 | string kprq = 9;
34 | }
35 |
36 | // The response message containing the greetings.
37 | message PushResult {
38 | int32 Code = 1;
39 | string Msg = 2;
40 | }
41 |
--------------------------------------------------------------------------------
/Tests/GrpcClient/appsettings.Development.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "LogLevel": {
4 | "Default": "Debug",
5 | "System": "Information",
6 | "Grpc": "Information",
7 | "Microsoft": "Information"
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/Tests/GrpcClient/appsettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "LogLevel": {
4 | "Default": "Warning",
5 | "Microsoft.Hosting.Lifetime": "Information"
6 | }
7 | },
8 | "AllowedHosts": "*",
9 | "Kestrel": {
10 | "EndpointDefaults": {
11 | "Protocols": "Http2"
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/Tests/MVC461/App_Start/WebApiConfig.cs:
--------------------------------------------------------------------------------
1 | using CodeArts.Runtime;
2 | using System.Linq;
3 | using System.Web.Http;
4 |
5 | namespace Mvc461
6 | {
7 | public static class WebApiConfig
8 | {
9 | public static void Register(HttpConfiguration config)
10 | {
11 | // Web API 配置和服务
12 |
13 | // Web API 路由
14 | config.MapHttpAttributeRoutes();
15 |
16 | var typeStore = TypeItem.Get(config.GetType());
17 |
18 | var propertyStore = typeStore.PropertyStores.First(x => x.Name == "Services");
19 |
20 | config.Routes.MapHttpRoute(
21 | name: "DefaultApi",
22 | routeTemplate: "api/{controller}/{id}",
23 | defaults: new { id = RouteParameter.Optional }
24 | );
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/Tests/MVC461/Domain/Entities/User.cs:
--------------------------------------------------------------------------------
1 | using CodeArts;
2 | using CodeArts.Db;
3 | using System;
4 | using System.ComponentModel;
5 | using System.ComponentModel.DataAnnotations;
6 |
7 | namespace Mvc461.Domain.Entities
8 | {
9 | ///
10 | /// 用户信息表。
11 | ///
12 | [Naming("yep_users", NamingType.UrlCase)]
13 | public class User : BaseEntity
14 | {
15 | ///
16 | /// 机构ID。
17 | ///
18 | public ulong OrgId { get; set; }
19 | ///
20 | /// 公司ID。
21 | ///
22 | public long CompanyId { get; set; }
23 | ///
24 | /// 账户。
25 | ///
26 | [Display(Name = "用户账户")]
27 | [Required(ErrorMessage = "{0}为必填项!")]
28 | public string Account { get; set; }
29 | ///
30 | /// 用户名称。
31 | ///
32 | [Display(Name = "用户名称")]
33 | [Required(ErrorMessage = "{0}为必填项!")]
34 | public string Name { get; set; }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/Tests/MVC461/Domain/UserRepository.cs:
--------------------------------------------------------------------------------
1 | using CodeArts.Db;
2 | using CodeArts.Db.Lts;
3 | using Mvc461.Domain.Entities;
4 |
5 | namespace Mvc461.Domain
6 | {
7 | ///
8 | /// 用户仓库。
9 | ///
10 | [DbConfig]
11 | public class UserRepository : DbRepository
12 | {
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/Tests/MVC461/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // 有关程序集的常规信息通过下列特性集
6 | // 控制。更改这些特性值可修改
7 | // 与程序集关联的信息。
8 | [assembly: AssemblyTitle("Mvc461")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("Mvc461")]
13 | [assembly: AssemblyCopyright("Copyright © 2019")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // 将 ComVisible 设置为 false 会使此程序集中的类型
18 | // 对 COM 组件不可见。如果需要
19 | // 从 COM 访问此程序集中的某个类型,请针对该类型将 ComVisible 特性设置为 true。
20 | [assembly: ComVisible(false)]
21 |
22 | // 如果此项目向 COM 公开,则下列 GUID 用于 typelib 的 ID
23 | [assembly: Guid("f3f2410e-7640-404b-b3ba-dbbf3203dc6b")]
24 |
25 | // 程序集的版本信息由下列四个值组成:
26 | //
27 | // 主版本
28 | // 次版本
29 | // 内部版本号
30 | // 修订版本
31 | //
32 | // 可以指定所有值,也可以使用“修订号”和“内部版本号”的默认值,
33 | // 方法是按如下所示使用 "*":
34 | [assembly: AssemblyVersion("1.0.0.0")]
35 | [assembly: AssemblyFileVersion("1.0.0.0")]
36 |
--------------------------------------------------------------------------------
/Tests/MVC461/Startup.cs:
--------------------------------------------------------------------------------
1 | using CodeArts;
2 | using CodeArts.Mvc;
3 | using Microsoft.Extensions.DependencyInjection;
4 | using System.ComponentModel.DataAnnotations;
5 | using System.Web.Http;
6 |
7 | namespace Mvc461
8 | {
9 | ///
10 | /// 启动类。
11 | ///
12 | public class Startup : JwtStartup
13 | {
14 | public Startup()
15 | {
16 | using (var startup = new XStartup())
17 | {
18 | startup.DoStartup();
19 | }
20 | }
21 | public override void Configuration(HttpConfiguration config)
22 | {
23 | base.Configuration(config);
24 |
25 | ModelValidator.CustomValidate((attr, context) =>
26 | {
27 | return $"{context.DisplayName}为必填字段!";
28 | });
29 | }
30 |
31 | ///
32 | public void ConfigureServices(IServiceCollection services)
33 | {
34 | services.UseDependencyInjection();
35 | }
36 | }
37 | }
--------------------------------------------------------------------------------
/Tests/MVC461/Web.Debug.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
17 |
18 |
30 |
31 |
--------------------------------------------------------------------------------
/Tests/MVC461/Web.Release.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
17 |
18 |
19 |
31 |
32 |
--------------------------------------------------------------------------------
/Tests/Mvc.Core/Domain/EfContext.cs:
--------------------------------------------------------------------------------
1 | using CodeArts.Db;
2 | using CodeArts.Db.EntityFramework;
3 | using Microsoft.EntityFrameworkCore;
4 | using Mvc.Core.Domain.Entities;
5 | using System;
6 | using System.Collections.Generic;
7 | using System.Linq;
8 | using System.Threading.Tasks;
9 |
10 | namespace Mvc.Core.Domain
11 | {
12 | ///
13 | /// 上下文。
14 | ///
15 | [DbConfig("connectionStrings:mssql")]
16 | public class EfContext : DbContext
17 | {
18 | ///
19 | /// 用户。
20 | ///
21 | public DbSet Users { get; set; }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Tests/Mvc.Core/Domain/Entities/User.cs:
--------------------------------------------------------------------------------
1 | using CodeArts;
2 | using CodeArts.Db;
3 | using System;
4 | using System.ComponentModel;
5 | using System.ComponentModel.DataAnnotations;
6 |
7 | namespace Mvc.Core.Domain.Entities
8 | {
9 | ///
10 | /// 用户信息表。
11 | ///
12 | [Naming("yep_users", NamingType.UrlCase)]
13 | public class User : BaseEntity
14 | {
15 | ///
16 | /// 机构ID。
17 | ///
18 | public ulong OrgId { get; set; }
19 | ///
20 | /// 公司ID。
21 | ///
22 | public long CompanyId { get; set; }
23 | ///
24 | /// 账户。
25 | ///
26 | [Display(Name = "用户账户")]
27 | [Required(ErrorMessage = "{0}为必填项!")]
28 | public string Account { get; set; }
29 | ///
30 | /// 用户名称。
31 | ///
32 | [Display(Name = "用户名称")]
33 | [Required(ErrorMessage = "{0}为必填项!")]
34 | public string Name { get; set; }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/Tests/Mvc.Core/Domain/UserRepository.cs:
--------------------------------------------------------------------------------
1 | using Mvc.Core.Domain.Entities;
2 | using CodeArts.Db;
3 | using CodeArts.Db.Lts;
4 |
5 | namespace Mvc.Core.Domain
6 | {
7 | ///
8 | /// 用户仓库。
9 | ///
10 | [DbConfig("connectionStrings:default")]
11 | public class UserRepository : DbRepository
12 | {
13 |
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Tests/Mvc.Core/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Threading.Tasks;
5 | using AspectCore.Extensions.DependencyInjection;
6 | using Microsoft.AspNetCore.Hosting;
7 | using Microsoft.Extensions.Configuration;
8 | using Microsoft.Extensions.Hosting;
9 | using Microsoft.Extensions.Logging;
10 |
11 | namespace Mvc.Core
12 | {
13 | ///
14 | public class Program
15 | {
16 | ///
17 | public static void Main(string[] args)
18 | {
19 | CreateHostBuilder(args).Build().Run();
20 | }
21 | ///
22 | public static IHostBuilder CreateHostBuilder(string[] args) =>
23 | Host.CreateDefaultBuilder(args)
24 | .ConfigureLogging(builder => builder.AddLog4Net("log4net.config", true))
25 | .ConfigureWebHostDefaults(webBuilder =>
26 | {
27 | webBuilder.UseStartup();
28 | });
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/Tests/Mvc.Core/Protos/push.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | option csharp_namespace = "Mvc.Core";
4 |
5 | package main;
6 |
7 | // The greeting service definition.
8 | service Push {
9 | // Sends a greeting
10 | rpc Push (PushRequest) returns (PushResult);
11 | }
12 |
13 | // The request message containing the user's name.
14 | message PushRequest {
15 | uint64 companyId = 1;
16 | string requestId = 2;
17 | enum InvoiceType {
18 | ELECTRIC = 0;
19 | NORMAL = 1;
20 | SPECIAL = 2;
21 | ROLL = 3;
22 | }
23 | InvoiceType invoiceType = 3;
24 | string invoiceCode = 4;
25 | string invoiceNo = 5;
26 | string jshj = 6;
27 | enum Ticket{
28 | BLUE = 0;
29 | RED = 1;
30 | }
31 | Ticket ticket = 7;
32 | string pdf = 8;
33 | string kprq = 9;
34 | }
35 |
36 | // The response message containing the greetings.
37 | message PushResult {
38 | int32 Code = 1;
39 | string Msg = 2;
40 | }
41 |
--------------------------------------------------------------------------------
/Tests/Mvc.Core/Services/PushService.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tinylit/codearts/5002d35735f4dc5318737bca346f261af199dc3b/Tests/Mvc.Core/Services/PushService.cs
--------------------------------------------------------------------------------
/Tests/Mvc.Core/Startup.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tinylit/codearts/5002d35735f4dc5318737bca346f261af199dc3b/Tests/Mvc.Core/Startup.cs
--------------------------------------------------------------------------------
/Tests/Mvc.Core/WeatherForecast.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel.DataAnnotations;
4 |
5 | namespace Mvc.Core
6 | {
7 | ///
8 | public class WeatherForecast
9 | {
10 | ///
11 | public DateTime? Date { get; set; }
12 |
13 | ///
14 | public int TemperatureC { get; set; }
15 |
16 | ///
17 | public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
18 |
19 | ///
20 | public List Codes { get; set; }
21 |
22 | ///
23 | [Required]
24 | public string Summary { get; set; }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/Tests/Mvc.Core/appsettings.Development.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "LogLevel": {
4 | "Default": "Debug",
5 | "System": "Information",
6 | "Microsoft": "Information"
7 | }
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/Tests/Mvc.Core/appsettings.json:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tinylit/codearts/5002d35735f4dc5318737bca346f261af199dc3b/Tests/Mvc.Core/appsettings.json
--------------------------------------------------------------------------------
/Tests/Mvc.Core2_1/Domain/Entities/User.cs:
--------------------------------------------------------------------------------
1 | using CodeArts;
2 | using CodeArts.Db;
3 | using System.ComponentModel.DataAnnotations;
4 |
5 | namespace Mvc.Core2_1.Domain.Entities
6 | {
7 | ///
8 | /// 用户信息表。
9 | ///
10 | [DbConfig("connectionStrings:default")]
11 | [Naming("yep_users", NamingType.UrlCase)]
12 | public class User : BaseEntity
13 | {
14 | ///
15 | /// 机构ID。
16 | ///
17 | public ulong OrgId { get; set; }
18 | ///
19 | /// 公司ID。
20 | ///
21 | public long CompanyId { get; set; }
22 | ///
23 | /// 账户。
24 | ///
25 | [Display(Name = "用户账户")]
26 | [Required(ErrorMessage = "{0}为必填项!")]
27 | public string Account { get; set; }
28 | ///
29 | /// 用户名称。
30 | ///
31 | [Display(Name = "用户名称")]
32 | [Required(ErrorMessage = "{0}为必填项!")]
33 | public string Name { get; set; }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/Tests/Mvc.Core2_1/Domain/UserRepository.cs:
--------------------------------------------------------------------------------
1 | using Mvc.Core2_1.Domain.Entities;
2 | using CodeArts.Db;
3 | using CodeArts.Db.Lts;
4 |
5 | namespace Mvc.Core2_1.Domain
6 | {
7 | ///
8 | /// 用户仓库。
9 | ///
10 | [DbConfig]
11 | public class UserRepository : DbRepository
12 | {
13 |
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Tests/Mvc.Core2_1/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Linq;
5 | using System.Threading.Tasks;
6 | using Microsoft.AspNetCore;
7 | using Microsoft.AspNetCore.Hosting;
8 | using Microsoft.Extensions.Configuration;
9 | using Microsoft.Extensions.Logging;
10 |
11 | namespace Mvc.Core2_1
12 | {
13 | ///
14 | public class Program
15 | {
16 | ///
17 | public static void Main(string[] args)
18 | {
19 | CreateWebHostBuilder(args).Build().Run();
20 | }
21 | ///
22 | public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
23 | WebHost.CreateDefaultBuilder(args)
24 | .UseStartup();
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/Tests/Mvc.Core2_1/appsettings.Development.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "LogLevel": {
4 | "Default": "Debug",
5 | "System": "Information",
6 | "Microsoft": "Information"
7 | }
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/Tests/Mvc.Core2_1/appsettings.json:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tinylit/codearts/5002d35735f4dc5318737bca346f261af199dc3b/Tests/Mvc.Core2_1/appsettings.json
--------------------------------------------------------------------------------
/Tests/Mvc.Core2_1/log4net.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/Tests/Mvc4/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // 有关程序集的常规信息通过下列特性集
6 | // 控制。更改这些特性值可修改
7 | // 与程序集关联的信息。
8 | [assembly: AssemblyTitle("Mvc4")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("Mvc4")]
13 | [assembly: AssemblyCopyright("Copyright © 2019")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // 将 ComVisible 设置为 false 会使此程序集中的类型
18 | // 对 COM 组件不可见。如果需要
19 | // 从 COM 访问此程序集中的某个类型,请针对该类型将 ComVisible 特性设置为 true。
20 | [assembly: ComVisible(false)]
21 |
22 | // 如果此项目向 COM 公开,则下列 GUID 用于 typelib 的 ID
23 | [assembly: Guid("92857809-f149-4e3c-835f-f2a3e0b5d3f1")]
24 |
25 | // 程序集的版本信息由下列四个值组成:
26 | //
27 | // 主版本
28 | // 次版本
29 | // 内部版本号
30 | // 修订版本
31 | //
32 | // 可以指定所有值,也可以使用“修订号”和“内部版本号”的默认值,
33 | // 方法是按如下所示使用 "*":
34 | [assembly: AssemblyVersion("1.0.0.0")]
35 | [assembly: AssemblyFileVersion("1.0.0.0")]
36 |
--------------------------------------------------------------------------------
/Tests/Mvc4/Startup.cs:
--------------------------------------------------------------------------------
1 | using CodeArts;
2 | using CodeArts.Mvc;
3 | using CodeArts.Mvc.Builder;
4 | using Microsoft.Extensions.DependencyInjection;
5 | using System;
6 |
7 | namespace Mvc4
8 | {
9 | public class Startup : JwtStartup
10 | {
11 | public Startup()
12 | {
13 | using (var startup = new XStartup())
14 | {
15 | startup.DoStartup();
16 | }
17 | }
18 | public void Configure(IApplicationBuilder builder, IServiceProvider serviceProvider)
19 | {
20 | base.Configure(builder.MapPost("/test", "/api/values/test"));
21 | }
22 |
23 | ///
24 | public void ConfigureServices(IServiceCollection services)
25 | {
26 | services.UseDependencyInjection();
27 | }
28 | }
29 | }
--------------------------------------------------------------------------------
/Tests/Mvc4/Views/TestView.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Web;
5 |
6 | namespace Mvc4.Views
7 | {
8 | public class TestView
9 | {
10 | public int Id { get; set; }
11 |
12 | public string Name { get; set; }
13 | }
14 | }
--------------------------------------------------------------------------------
/Tests/Mvc4/Web.Debug.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
17 |
18 |
30 |
31 |
--------------------------------------------------------------------------------
/Tests/Mvc4/Web.Release.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
17 |
18 |
19 |
31 |
32 |
--------------------------------------------------------------------------------
/Tests/Mvc4/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Tests/Mvc45/Controllers/ValuesController.cs:
--------------------------------------------------------------------------------
1 | using CodeArts;
2 | using CodeArts.Exceptions;
3 | using CodeArts.Mvc;
4 | using System;
5 | using System.Collections.Generic;
6 | using System.Web.Http;
7 |
8 | namespace Mvc45.Controllers
9 | {
10 | ///
11 | public interface IDependency
12 | {
13 |
14 | }
15 | ///
16 | public class Dependency : IDependency
17 | {
18 |
19 | }
20 |
21 | ///
22 | public class ValuesController : BaseController
23 | {
24 | ///
25 | public ValuesController(IDependency dependency)
26 | {
27 | }
28 |
29 | ///
30 | [HttpGet]
31 | public IEnumerable Get()
32 | {
33 | return new string[] { "value1", "value2" };
34 | }
35 |
36 | ///
37 | [HttpPost]
38 | public void Post([FromBody] string value)
39 | {
40 | }
41 |
42 | ///
43 | [HttpPut]
44 | public void Put(int id, [FromBody] string value)
45 | {
46 | }
47 |
48 | ///
49 | [Authorize]
50 | [HttpDelete]
51 | public void Delete(int id)
52 | {
53 | throw new BusiException("认证测试成功");
54 | }
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/Tests/Mvc45/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // 有关程序集的常规信息通过下列特性集
6 | // 控制。更改这些特性值可修改
7 | // 与程序集关联的信息。
8 | [assembly: AssemblyTitle("Mvc45")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("Mvc45")]
13 | [assembly: AssemblyCopyright("Copyright © 2019")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // 将 ComVisible 设置为 false 会使此程序集中的类型
18 | // 对 COM 组件不可见。如果需要
19 | // 从 COM 访问此程序集中的某个类型,请针对该类型将 ComVisible 特性设置为 true。
20 | [assembly: ComVisible(false)]
21 |
22 | // 如果此项目向 COM 公开,则下列 GUID 用于 typelib 的 ID
23 | [assembly: Guid("760f79bb-86ec-4a71-b65e-3cbda370fed1")]
24 |
25 | // 程序集的版本信息由下列四个值组成:
26 | //
27 | // 主版本
28 | // 次版本
29 | // 内部版本号
30 | // 修订版本
31 | //
32 | // 可以指定所有值,也可以使用“修订号”和“内部版本号”的默认值,
33 | // 方法是按如下所示使用 "*":
34 | [assembly: AssemblyVersion("1.0.0.0")]
35 | [assembly: AssemblyFileVersion("1.0.0.0")]
36 |
--------------------------------------------------------------------------------
/Tests/Mvc45/Startup.cs:
--------------------------------------------------------------------------------
1 | using CodeArts;
2 | using CodeArts.Mvc;
3 | using Microsoft.Extensions.DependencyInjection;
4 |
5 | namespace Mvc45
6 | {
7 | public class Startup : JwtStartup
8 | {
9 | public Startup()
10 | {
11 | using (var startup = new XStartup())
12 | {
13 | startup.DoStartup();
14 | }
15 | }
16 |
17 | ///
18 | public void ConfigureServices(IServiceCollection services)
19 | {
20 | services.UseDependencyInjection();
21 | }
22 | }
23 | }
--------------------------------------------------------------------------------
/Tests/Mvc45/Web.Debug.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
17 |
18 |
30 |
31 |
--------------------------------------------------------------------------------
/Tests/Mvc45/Web.Release.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
17 |
18 |
19 |
31 |
32 |
--------------------------------------------------------------------------------
/Tests/Mvc45/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/codearts.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tinylit/codearts/5002d35735f4dc5318737bca346f261af199dc3b/codearts.png
--------------------------------------------------------------------------------
/project.json:
--------------------------------------------------------------------------------
1 | {
2 | "dependencies": {
3 | "netstandard.library": "1.6.0"
4 | },
5 | "frameworks": {
6 | "netstandard2.0": {
7 | "imports": "dnxcore50"
8 | },
9 | "net40": {}
10 | },
11 | "buildOptions": {
12 | "xmlDoc": true
13 | }
14 | }
--------------------------------------------------------------------------------
/src/CodeArts.Caching/CodeArts.Caching.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net461;net45;net40;netstandard2.0;netstandard2.1;
5 | $(LibraryFrameworks)
6 | false
7 | true
8 | 8.1.5
9 | Tiny Lit
10 | Tiny Lit
11 | The caching control center.
12 | https://github.com/tinylit/codearts/blob/master/LICENSE.txt
13 | https://github.com/tinylit/codearts
14 | git
15 | https://github.com/tinylit/codearts/blob/master/LICENSE.txt
16 | https://raw.githubusercontent.com/tinylit/codearts/master/codearts.png
17 | https://github.com/tinylit/codearts
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/src/CodeArts.Caching/ICachingProvider.cs:
--------------------------------------------------------------------------------
1 |
2 | namespace CodeArts.Caching
3 | {
4 | ///
5 | /// 缓存服务供应商。
6 | ///
7 | public interface ICachingProvider
8 | {
9 | /// 获取缓存对象。
10 | /// 缓存名称。
11 | ///
12 | ICaching GetCache(string name);
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/CodeArts.Caching/Level.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.ComponentModel;
3 |
4 | namespace CodeArts.Caching
5 | {
6 | /// 缓存级别。
7 | [Flags]
8 | public enum Level
9 | {
10 | /// 一级缓存,本机内存。
11 | [Description("一级缓存")]
12 | First = 1,
13 |
14 | /// 二级缓存,分布式。
15 | [Description("二级缓存")]
16 | Second = 2,
17 |
18 | /// 三级缓存,预留。
19 | [Description("三级缓存")]
20 | Third = 4
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/CodeArts.Casting/CastingStartup.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace CodeArts.Casting
8 | {
9 | ///
10 | /// 启动。
11 | ///
12 | public class CastingStartup : IStartup
13 | {
14 | ///
15 | /// 功能码。
16 | ///
17 | public int Code => 100;
18 |
19 | ///
20 | /// 权重。
21 | ///
22 | public int Weight => 1;
23 |
24 | ///
25 | /// 启动。
26 | ///
27 | public void Startup() => RuntimeServPools.TryAddSingleton();
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/CodeArts.Casting/CodeArts.Casting.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net461;net45;net40;netstandard2.0;netstandard2.1;
5 | $(LibraryFrameworks)
6 | false
7 | true
8 | 8.1.5
9 | Tiny Lit
10 | Tiny Lit
11 | The type conversion.
12 | https://github.com/tinylit/codearts/blob/master/LICENSE.txt
13 | https://github.com/tinylit/codearts
14 | git
15 | https://github.com/tinylit/codearts/blob/master/LICENSE.txt
16 | https://raw.githubusercontent.com/tinylit/codearts/master/codearts.png
17 | https://github.com/tinylit/codearts
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/src/CodeArts.Casting/IMapConfiguration.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq.Expressions;
3 |
4 | namespace CodeArts.Casting
5 | {
6 | ///
7 | /// 映射。
8 | ///
9 | public interface IMapConfiguration : IProfileConfiguration
10 | {
11 | ///
12 | /// 映射。
13 | ///
14 | /// 结果类型。
15 | /// 源对象。
16 | /// 默认值。
17 | ///
18 | TResult Map(object source, TResult def = default);
19 |
20 | ///
21 | /// 映射。
22 | ///
23 | /// 源数据。
24 | /// 目标类型。
25 | /// 目标默认值。
26 | ///
27 | Expression Map(Expression sourceExpression, Type conversionType, Expression def = null);
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/CodeArts.Casting/IMapExpression.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace CodeArts.Casting
4 | {
5 | ///
6 | /// 映射。
7 | ///
8 | public interface IMapExpression
9 | {
10 | ///
11 | /// 是否匹配。
12 | ///
13 | /// 源类型。
14 | /// 目标类型。
15 | ///
16 | bool IsMatch(Type sourceType, Type conversionType);
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/CodeArts.Casting/IProfile.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace CodeArts.Casting
4 | {
5 | ///
6 | /// 配置文件。
7 | ///
8 | public interface IProfile
9 | {
10 | ///
11 | /// 创建工厂。
12 | ///
13 | /// 源数据类型。
14 | /// 目标数据类型。
15 | ///
16 | Func