Showing preview only (2,341K chars total). Download the full file or copy to clipboard to get everything.
Repository: WeihanLi/WeihanLi.Common
Branch: dev
Commit: 62cd7ad986c2
Files: 445
Total size: 2.1 MB
Directory structure:
gitextract_2b22jhad/
├── .config/
│ └── dotnet-tools.json
├── .copilot-instructions.md
├── .devcontainer/
│ ├── devcontainer.json
│ └── scripts/
│ └── post-creation.sh
├── .editorconfig
├── .gitattributes
├── .github/
│ └── workflows/
│ ├── copilot-setup-steps.yml
│ ├── default.yml
│ ├── docfx.yml
│ ├── dotnet-format.yml
│ └── release.yml
├── .gitignore
├── .husky/
│ ├── commit-msg
│ ├── post-push
│ ├── pre-commit
│ ├── pre-push
│ ├── scripts/
│ │ └── commit-lint.cs
│ └── task-runner.json
├── AGENTS.md
├── Directory.Build.props
├── Directory.Build.targets
├── Directory.Packages.props
├── LICENSE
├── README.md
├── WeihanLi.Common.sln.DotSettings
├── WeihanLi.Common.slnx
├── azure-pipelines.yml
├── build/
│ ├── exportReleaseVersion.cs
│ ├── sign.props
│ ├── version.props
│ └── weihanli.snk
├── build.cs
├── docs/
│ ├── .gitignore
│ ├── ReleaseNotes.md
│ ├── api/
│ │ ├── .gitignore
│ │ └── index.md
│ ├── articles/
│ │ ├── intro.md
│ │ └── toc.yml
│ ├── docfx.json
│ ├── index.md
│ └── toc.yml
├── nuget.config
├── perf/
│ └── WeihanLi.Common.Benchmark/
│ ├── BenchmarkDotNet.Artifacts/
│ │ └── results/
│ │ ├── CreateInstanceTest-report-github.md
│ │ ├── CreateInstanceTest-report.csv
│ │ ├── CreateInstanceTest-report.html
│ │ ├── DITest-report-github.md
│ │ ├── DITest-report.csv
│ │ ├── DITest-report.html
│ │ ├── WeihanLi.Common.Benchmark.DITest-report-github.md
│ │ ├── WeihanLi.Common.Benchmark.DITest-report.csv
│ │ ├── WeihanLi.Common.Benchmark.DITest-report.html
│ │ ├── WeihanLi.Common.Benchmark.MapperTest-report-github.md
│ │ ├── WeihanLi.Common.Benchmark.MapperTest-report.csv
│ │ ├── WeihanLi.Common.Benchmark.MapperTest-report.html
│ │ ├── WeihanLi.Common.Benchmark.PipelineTest-report-github.md
│ │ ├── WeihanLi.Common.Benchmark.PipelineTest-report.csv
│ │ └── WeihanLi.Common.Benchmark.PipelineTest-report.html
│ ├── DITest.cs
│ ├── PipelineTest.cs
│ ├── Program.cs
│ └── WeihanLi.Common.Benchmark.csproj
├── samples/
│ ├── AspNetCoreSample/
│ │ ├── AspNetCoreSample.csproj
│ │ ├── Controllers/
│ │ │ ├── EventsController.cs
│ │ │ └── HomeController.cs
│ │ ├── Events/
│ │ │ ├── EventConsumer.cs
│ │ │ └── PageViewEvent.cs
│ │ ├── FluentAspectsServiceProviderFactory.cs
│ │ ├── LogInterceptor.cs
│ │ ├── Models/
│ │ │ └── ErrorViewModel.cs
│ │ ├── Program.cs
│ │ ├── Startup.cs
│ │ ├── Views/
│ │ │ ├── Home/
│ │ │ │ ├── About.cshtml
│ │ │ │ ├── Contact.cshtml
│ │ │ │ └── Index.cshtml
│ │ │ ├── Shared/
│ │ │ │ ├── Error.cshtml
│ │ │ │ ├── _Layout.cshtml
│ │ │ │ └── _ValidationScriptsPartial.cshtml
│ │ │ ├── _ViewImports.cshtml
│ │ │ └── _ViewStart.cshtml
│ │ ├── appsettings.json
│ │ ├── bundleconfig.json
│ │ └── wwwroot/
│ │ ├── css/
│ │ │ └── site.css
│ │ ├── js/
│ │ │ └── site.js
│ │ └── lib/
│ │ ├── bootstrap/
│ │ │ ├── .bower.json
│ │ │ ├── LICENSE
│ │ │ └── dist/
│ │ │ ├── css/
│ │ │ │ ├── bootstrap-theme.css
│ │ │ │ └── bootstrap.css
│ │ │ └── js/
│ │ │ ├── bootstrap.js
│ │ │ └── npm.js
│ │ ├── jquery/
│ │ │ ├── .bower.json
│ │ │ ├── LICENSE.txt
│ │ │ └── dist/
│ │ │ └── jquery.js
│ │ ├── jquery-validation/
│ │ │ ├── .bower.json
│ │ │ ├── LICENSE.md
│ │ │ └── dist/
│ │ │ ├── additional-methods.js
│ │ │ └── jquery.validate.js
│ │ └── jquery-validation-unobtrusive/
│ │ ├── .bower.json
│ │ └── jquery.validate.unobtrusive.js
│ └── DotNetCoreSample/
│ ├── App.config
│ ├── AppHostTest.cs
│ ├── AspectTest.cs
│ ├── Base64UrlEncodeTest.cs
│ ├── CommandExecutorTest.cs
│ ├── CronHelperTest.cs
│ ├── DataExtensionTest.cs
│ ├── DependencyInjectionTest.cs
│ ├── DisposeTest.cs
│ ├── DotNetCoreSample.csproj
│ ├── EventTest.cs
│ ├── GroupByEqualitySample.cs
│ ├── HttpRequesterTest.cs
│ ├── InMemoryStreamTest.cs
│ ├── LoggerTest.cs
│ ├── MapperTest.cs
│ ├── NewtonJsonFormatter.cs
│ ├── PagedListResultTest.cs
│ ├── PipelineTest.cs
│ ├── ProcessExecutorTest.cs
│ ├── Program.cs
│ ├── RepositoryTest.cs
│ ├── RequestHelperTest.cs
│ ├── SerilogTest.cs
│ ├── ServiceDecoratorTest.cs
│ ├── TaskTest.cs
│ ├── TemplatingSample.cs
│ ├── Test/
│ │ └── PagedListModel1.cs
│ ├── TotpTest.cs
│ └── appsettings.json
├── src/
│ ├── Directory.Build.props
│ ├── WeihanLi.Common/
│ │ ├── Abstractions/
│ │ │ └── Properties.cs
│ │ ├── Aspect/
│ │ │ ├── AspectDelegate.cs
│ │ │ ├── AspectInvokeException.cs
│ │ │ ├── AttributeInterceptorResolver.cs
│ │ │ ├── DefaultProxyFactory.cs
│ │ │ ├── DefaultProxyTypeFactory.cs
│ │ │ ├── DelegateInterceptor.cs
│ │ │ ├── FluentAspectOptions.cs
│ │ │ ├── FluentAspectOptionsExtensions.cs
│ │ │ ├── FluentAspects.cs
│ │ │ ├── FluentAspectsBuilder.cs
│ │ │ ├── FluentAspectsServiceContainerBuilder.cs
│ │ │ ├── FluentConfigInterceptorResolver.cs
│ │ │ ├── IInterceptionConfiguration.cs
│ │ │ ├── IInterceptor.cs
│ │ │ ├── IInterceptorResolver.cs
│ │ │ ├── IInvocation.cs
│ │ │ ├── IProxyFactory.cs
│ │ │ ├── IProxyTypeFactory.cs
│ │ │ ├── InternalAspectHelper.cs
│ │ │ ├── InvocationEnricher.cs
│ │ │ ├── InvocationEnricherExtensions.cs
│ │ │ ├── MethodSignature.cs
│ │ │ ├── ProxyFactoryExtensions.cs
│ │ │ ├── ProxyUtils.cs
│ │ │ ├── ServiceCollectionExtensions.cs
│ │ │ └── ServiceContainerBuilderExtensions.cs
│ │ ├── CacheUtil.cs
│ │ ├── Compressor/
│ │ │ └── DataCompressor.cs
│ │ ├── Data/
│ │ │ ├── Expressions/
│ │ │ │ ├── DateTimeExpressionParser.cs
│ │ │ │ └── StringExpressionParser.cs
│ │ │ ├── IRepository.cs
│ │ │ ├── IUnitOfWork.cs
│ │ │ ├── Repository.cs
│ │ │ ├── RepositoryExtension.cs
│ │ │ ├── SqlExpressionParser.cs
│ │ │ ├── SqlExpressionVisitor.cs
│ │ │ └── UnitOfWork.cs
│ │ ├── DependencyInjection/
│ │ │ ├── DependencyInjectionExtensions.cs
│ │ │ ├── FromServiceAttribute.cs
│ │ │ ├── ServiceConstructorAttribute.cs
│ │ │ ├── ServiceContainer.cs
│ │ │ ├── ServiceContainerBuilder.cs
│ │ │ ├── ServiceContainerBuilderExtensions.cs
│ │ │ ├── ServiceContainerBuilderExtensions.generated.cs
│ │ │ ├── ServiceContainerBuilderExtensions.tt
│ │ │ ├── ServiceContainerModule.cs
│ │ │ ├── ServiceDefinition.cs
│ │ │ └── ServiceLifetime.cs
│ │ ├── DependencyResolver.cs
│ │ ├── Event/
│ │ │ ├── AckQueue.cs
│ │ │ ├── DelegateEventHandler.cs
│ │ │ ├── EventBase.cs
│ │ │ ├── EventBus.cs
│ │ │ ├── EventBusExtensions.cs
│ │ │ ├── EventHandler.cs
│ │ │ ├── EventHandlerFactory.cs
│ │ │ ├── EventProperties.cs
│ │ │ ├── EventQueueInMemory.cs
│ │ │ ├── EventQueuePublisher.cs
│ │ │ ├── EventStoreInMemory.cs
│ │ │ ├── EventSubscriptionManager.cs
│ │ │ ├── IEventBus.cs
│ │ │ ├── IEventHandlerFactory.cs
│ │ │ ├── IEventPublisher.cs
│ │ │ ├── IEventQueue.cs
│ │ │ ├── IEventStore.cs
│ │ │ └── IEventSubscriber.cs
│ │ ├── Extensions/
│ │ │ ├── CollectionExtension.cs
│ │ │ ├── CompressionExtension.cs
│ │ │ ├── ConfigurationExtension.cs
│ │ │ ├── CoreExtension.cs
│ │ │ ├── CronExtension.cs
│ │ │ ├── DataExtension.cs
│ │ │ ├── DbCommandExtension.generated.cs
│ │ │ ├── DbCommandExtension.tt
│ │ │ ├── DbConnectionExtension.generated.cs
│ │ │ ├── DbConnectionExtension.tt
│ │ │ ├── DictionaryExtension.cs
│ │ │ ├── DumpExtension.cs
│ │ │ ├── EnumerableExtension.cs
│ │ │ ├── ExceptionExtension.cs
│ │ │ ├── ExpressionExtension.cs
│ │ │ ├── FuncExtension.cs
│ │ │ ├── HttpClientExtension.cs
│ │ │ ├── HttpRequesterExtension.cs
│ │ │ ├── ILGeneratorExtensions.cs
│ │ │ ├── IOExtension.cs
│ │ │ ├── JsonSerializeExtension.cs
│ │ │ ├── NetExtension.cs
│ │ │ ├── ProcessExtension.cs
│ │ │ ├── PropertiesExtensions.cs
│ │ │ ├── QueryableExtension.cs
│ │ │ ├── ReflectionExtension.cs
│ │ │ ├── ServiceCollectionExtension.cs
│ │ │ ├── StringExtension.cs
│ │ │ ├── TaskExtension.cs
│ │ │ └── TypeExtension.cs
│ │ ├── Guard.cs
│ │ ├── Helpers/
│ │ │ ├── ActivatorHelper.cs
│ │ │ ├── ApplicationHelper.cs
│ │ │ ├── ArrayHelper.cs
│ │ │ ├── AsyncLock.cs
│ │ │ ├── Base32EncodeHelper.cs
│ │ │ ├── Base64UrlEncodeHelper.cs
│ │ │ ├── BoundedConcurrentQueue.cs
│ │ │ ├── BuildProcess.cs
│ │ │ ├── Combinatorics/
│ │ │ │ ├── Combinations.cs
│ │ │ │ ├── GenerateOption.cs
│ │ │ │ ├── Permutations.cs
│ │ │ │ ├── SmallPrimeUtility.cs
│ │ │ │ └── Variations.cs
│ │ │ ├── CommandExecutor.cs
│ │ │ ├── CommandLineParser.cs
│ │ │ ├── ConcurrentSet.cs
│ │ │ ├── ConsoleHelper.cs
│ │ │ ├── ConsoleOutput.cs
│ │ │ ├── ContextAccessor.cs
│ │ │ ├── ConvertHelper.cs
│ │ │ ├── Cron/
│ │ │ │ ├── CalendarHelper.cs
│ │ │ │ ├── CronExpression.cs
│ │ │ │ ├── CronExpressionFlag.cs
│ │ │ │ ├── CronField.cs
│ │ │ │ ├── CronFormat.cs
│ │ │ │ ├── CronFormatException.cs
│ │ │ │ └── TimeZoneHelper.cs
│ │ │ ├── CronHelper.cs
│ │ │ ├── DataSerializer.cs
│ │ │ ├── DelegateHelper.cs
│ │ │ ├── DelegateTextWriter.cs
│ │ │ ├── DiagnosticHelper.cs
│ │ │ ├── DisposableHelper.cs
│ │ │ ├── Encoder.cs
│ │ │ ├── Enricher.cs
│ │ │ ├── EnumHelper.cs
│ │ │ ├── EnvHelper.cs
│ │ │ ├── ExpressionHelper.cs
│ │ │ ├── HashHelper.cs
│ │ │ ├── Hosting/
│ │ │ │ ├── AppHost.cs
│ │ │ │ ├── AppHostBuilder.cs
│ │ │ │ ├── AppHostBuilderExtensions.cs
│ │ │ │ ├── AppHostBuilderSettings.cs
│ │ │ │ ├── AppHostOptions.cs
│ │ │ │ ├── BackgroundService.cs
│ │ │ │ ├── CronBasedBackgroundService.cs
│ │ │ │ ├── IHostedService.cs
│ │ │ │ └── TimerBaseBackgroundService.cs
│ │ │ ├── HttpHelper.cs
│ │ │ ├── InMemoryStream.cs
│ │ │ ├── InterlockedHelper.cs
│ │ │ ├── InteropHelper.cs
│ │ │ ├── InvokeHelper.cs
│ │ │ ├── JsonHelper.cs
│ │ │ ├── LogHelper.cs
│ │ │ ├── MapHelper.cs
│ │ │ ├── NetHelper.cs
│ │ │ ├── NewFuncHelper.cs
│ │ │ ├── PeriodBatching/
│ │ │ │ ├── BatchedConnectionStatus.cs
│ │ │ │ ├── PeriodicBatching.cs
│ │ │ │ └── PortableTimer.cs
│ │ │ ├── PipelineBuilder.cs
│ │ │ ├── Pipelines/
│ │ │ │ ├── AsyncPipelineBuilder.cs
│ │ │ │ ├── PipelineBuilder.cs
│ │ │ │ ├── PipelineBuilderExtensions.cs
│ │ │ │ ├── PipelineMiddleware.cs
│ │ │ │ └── ValueAsyncPipelineBuilder.cs
│ │ │ ├── ProcessExecutor.cs
│ │ │ ├── ProfilerHelper.cs
│ │ │ ├── ReflectHelper.cs
│ │ │ ├── RequestHelper.cs
│ │ │ ├── RetryHelper.cs
│ │ │ ├── SecurityHelper.cs
│ │ │ ├── SequentialGuidGenerator.cs
│ │ │ ├── StringHelper.cs
│ │ │ ├── TaskHelper.cs
│ │ │ ├── TotpHelper.cs
│ │ │ ├── TypeHelper.cs
│ │ │ ├── ValidateHelper.cs
│ │ │ └── ValueStopwatch.cs
│ │ ├── Http/
│ │ │ ├── HttpHeaderNames.cs
│ │ │ ├── HttpRequester.cs
│ │ │ ├── IHttpRequester.cs
│ │ │ ├── JsonHttpContent.cs
│ │ │ ├── MockHttpHandler.cs
│ │ │ └── NoProxyHttpClientHandler.cs
│ │ ├── IDependencyResolver.cs
│ │ ├── Json/
│ │ │ ├── DateTimeFormatConverter.cs
│ │ │ └── IPAddressConverter.cs
│ │ ├── Logging/
│ │ │ ├── ConsoleLoggingProvider.cs
│ │ │ ├── FileLoggingProcessor.cs
│ │ │ ├── LogHelperExtensions.cs
│ │ │ ├── LogHelperFactory.cs
│ │ │ ├── LogHelperLogLevel.cs
│ │ │ ├── LogHelperLogger.cs
│ │ │ ├── LogHelperLoggingEvent.cs
│ │ │ ├── LogHelperProvider.cs
│ │ │ ├── LoggerGeneric.cs
│ │ │ ├── LoggingBuilder.cs
│ │ │ ├── LoggingEnricher.cs
│ │ │ ├── LoggingFormatter.cs
│ │ │ ├── MicrosoftLoggingLogHelperProvider.cs
│ │ │ ├── MicrosoftLoggingLoggerExtensions.cs
│ │ │ └── PeriodBatchingLoggingService.cs
│ │ ├── Models/
│ │ │ ├── BaseEntity.cs
│ │ │ ├── Category.cs
│ │ │ ├── DataOperationType.cs
│ │ │ ├── IdNameModel.cs
│ │ │ ├── KeyEntry.cs
│ │ │ ├── ModelValidator.cs
│ │ │ ├── Ordering.cs
│ │ │ ├── PagedListResult.cs
│ │ │ ├── PagedRequest.cs
│ │ │ ├── Result.cs
│ │ │ ├── ResultStatus.cs
│ │ │ ├── ReviewState.cs
│ │ │ ├── SoftDeleteEntity.cs
│ │ │ ├── StringValueDictionary.cs
│ │ │ ├── TenantInfo.cs
│ │ │ └── ValidationResult.cs
│ │ ├── Otp/
│ │ │ ├── OtpHashAlgorithm.cs
│ │ │ ├── Totp.cs
│ │ │ └── TotpOptions.cs
│ │ ├── Polyfill/
│ │ │ └── TaskCompletionSource.cs
│ │ ├── README.md
│ │ ├── Resource.Designer.cs
│ │ ├── Resource.resx
│ │ ├── Services/
│ │ │ ├── CancellationTokenProvider.cs
│ │ │ ├── IProfiler.cs
│ │ │ ├── IScope.cs
│ │ │ ├── ITenantProvider.cs
│ │ │ ├── IdGenerator.cs
│ │ │ ├── TotpService.cs
│ │ │ ├── UserIdProvider.cs
│ │ │ ├── Validator.cs
│ │ │ └── Wrapper.cs
│ │ ├── Template/
│ │ │ ├── ConfigurationRenderMiddleare.cs
│ │ │ ├── DefaultRenderMiddleware.cs
│ │ │ ├── DefaultTemplateParser.cs
│ │ │ ├── DefaultTemplateRenderer.cs
│ │ │ ├── DependencyInjectionExtensions.cs
│ │ │ ├── EnvRenderMiddleware.cs
│ │ │ ├── IRenderMiddleware.cs
│ │ │ ├── ITemplateEngine.cs
│ │ │ ├── ITemplateParser.cs
│ │ │ ├── ITemplatePipe.cs
│ │ │ ├── ITemplateRenderer.cs
│ │ │ ├── ITemplateRendererBuilder.cs
│ │ │ ├── TemplateEngine.cs
│ │ │ ├── TemplateEngineOptions.cs
│ │ │ ├── TemplateEngineServiceBuilder.cs
│ │ │ ├── TemplatePipes.cs
│ │ │ ├── TemplateRenderContext.cs
│ │ │ └── TemplateRendererBuilder.cs
│ │ └── WeihanLi.Common.csproj
│ ├── WeihanLi.Common.Logging.Serilog/
│ │ ├── README.md
│ │ ├── SerilogHelper.cs
│ │ ├── SerilogLogHelperProvider.cs
│ │ ├── SerilogLogger.cs
│ │ ├── SerilogLoggerExtensions.cs
│ │ ├── SerilogLoggerProvider.cs
│ │ ├── SerilogLoggerScope.cs
│ │ └── WeihanLi.Common.Logging.Serilog.csproj
│ └── WeihanLi.Extensions.Hosting/
│ ├── CronBasedBackgroundService.cs
│ ├── HostingExtensions.cs
│ ├── README.md
│ ├── TimerBaseBackgroundService.cs
│ └── WeihanLi.Extensions.Hosting.csproj
├── test/
│ └── WeihanLi.Common.Test/
│ ├── AspectTest/
│ │ ├── ProxyFactoryTest.cs
│ │ ├── ServiceCollectionBuildTest.cs
│ │ ├── ServiceContainerBuilderBuildTest.cs
│ │ └── TestOutputInterceptor.cs
│ ├── AsyncLockTest.cs
│ ├── CacheUtilTest.cs
│ ├── CompressorTest/
│ │ └── DataCompressorTest.cs
│ ├── DependencyInjectionTest.cs
│ ├── DisposalTest.cs
│ ├── EventsTest/
│ │ ├── AckQueueTest.cs
│ │ ├── EventBaseTest.cs
│ │ └── EventBusTest.cs
│ ├── ExtensionsTest/
│ │ ├── CollectionExtensionTest.cs
│ │ ├── CompressExtensionTest.cs
│ │ ├── ConfigurationExtensionTest.cs
│ │ ├── CoreExtensionTest.cs
│ │ ├── EnumerableExtensionTest.cs
│ │ ├── ServiceCollectionExtensionTest.cs
│ │ ├── StringExtensionTest.cs
│ │ ├── TaskExtensionsTest.cs
│ │ └── TypeExtensionTest.cs
│ ├── HelpersTest/
│ │ ├── ApplicationHelperTest.cs
│ │ ├── BoundedConcurrentQueue.cs
│ │ ├── CommandExecutorTest.cs
│ │ ├── ConsoleHelperTest.cs
│ │ ├── EncoderTest.cs
│ │ ├── EnumHelperTest.cs
│ │ ├── NetHelperTest.cs
│ │ ├── ProcessExecutorTest.cs
│ │ ├── SecurityHelperTest.cs
│ │ ├── StringHelperTest.cs
│ │ ├── TotpHelperTest.cs
│ │ └── ValidateHelperTest.cs
│ ├── HttpTest/
│ │ └── MockHttpHandlerTest.cs
│ ├── IdGeneratorTest.cs
│ ├── JsonTest/
│ │ └── JsonConvertTest.cs
│ ├── ModelsTest/
│ │ ├── PagedListDataTest.cs
│ │ ├── PagedRequestTest.cs
│ │ ├── ResultTest.cs
│ │ ├── ReviewModelTest.cs
│ │ └── StringValueDictionaryTest.cs
│ ├── ProfilerTest.cs
│ ├── ServicesTest/
│ │ ├── CancellationTokenProviderTest.cs
│ │ ├── TotpServiceTest.cs
│ │ └── UserIdProviderTest.cs
│ ├── TemplateTest/
│ │ ├── TemplateParserTest.cs
│ │ └── TemplateRendererTest.cs
│ └── WeihanLi.Common.Test.csproj
└── toc.yml
================================================
FILE CONTENTS
================================================
================================================
FILE: .config/dotnet-tools.json
================================================
{
"version": 1,
"isRoot": true,
"tools": {
"husky": {
"version": "0.6.4",
"commands": [
"husky"
]
}
}
}
================================================
FILE: .copilot-instructions.md
================================================
# WeihanLi.Common - Copilot Instructions
## Project Overview
WeihanLi.Common is a comprehensive .NET utility library providing common helpers, extensions, and utilities for .NET applications. The library includes dependency injection, AOP (Aspect-Oriented Programming), event handling, logging, data access extensions, TOTP implementation, template engine, and much more.
## Project Structure
```
├── src/ # Main source code
│ ├── WeihanLi.Common/ # Core library
│ ├── WeihanLi.Common.Logging.Serilog/ # Serilog integration
│ └── WeihanLi.Extensions.Hosting/ # Hosting extensions
├── test/ # Unit tests
│ └── WeihanLi.Common.Test/ # Test projects using xUnit
├── samples/ # Sample applications
│ ├── AspNetCoreSample/ # ASP.NET Core examples
│ └── DotNetCoreSample/ # Console app examples
├── perf/ # Performance benchmarks
├── docs/ # Documentation using DocFX
├── build/ # Build scripts and tools
└── .github/ # CI/CD workflows
```
## Key Components
### Core Features
- **Dependency Injection**: Custom DI container similar to Microsoft's framework
- **Fluent Aspects (AOP)**: Dynamic proxy-based AOP framework
- **Event System**: EventBus, EventQueue, and EventStore implementations
- **Logging Framework**: Integration with Serilog and Microsoft logging
- **Data Extensions**: Dapper-like ADO.NET extensions for database operations
- **TOTP Implementation**: Time-based One-Time Password algorithm
- **Template Engine**: Custom template processing engine
- **HTTP Utilities**: HTTP client extensions and utilities
- **Guard Utilities**: Parameter validation helpers
- **Compression**: Data compression utilities
- **Extensions**: Extensive extension methods for common types
### Namespace Organization
- `WeihanLi.Common` - Core utilities and Guard classes
- `WeihanLi.Common.Aspect` - AOP framework components
- `WeihanLi.Common.Data` - Database and data access utilities
- `WeihanLi.Common.DependencyInjection` - DI container implementation
- `WeihanLi.Common.Event` - Event handling system
- `WeihanLi.Common.Extensions` - Extension methods for various types
- `WeihanLi.Common.Helpers` - Utility helper classes
- `WeihanLi.Common.Http` - HTTP-related utilities
- `WeihanLi.Common.Logging` - Logging abstractions and implementations
- `WeihanLi.Common.Otp` - TOTP and OTP implementations
- `WeihanLi.Common.Services` - Common service implementations
- `WeihanLi.Common.Template` - Template engine components
## Code Style and Conventions
### General Guidelines
- **Target Frameworks**: netstandard2.0, net8.0, net9.0, net10.0
- **Language Features**: C# with nullable reference types enabled, implicit usings
- **License**: Apache License 2.0
- **Naming**: PascalCase for public members, camelCase for private fields, following the editorconfig
- **Null Safety**: Extensive use of nullable annotations and Guard utilities
### Common Patterns
#### Guard Usage
Always validate parameters using the Guard class:
```csharp
public static string Process(string input)
{
Guard.NotNullOrEmpty(input);
// implementation
}
```
#### Extension Method Pattern
Extension methods should be in dedicated files with descriptive names:
```csharp
namespace WeihanLi.Extensions;
public static class StringExtension
{
public static bool IsNullOrEmpty(this string? str) => string.IsNullOrEmpty(str);
}
```
#### Configuration Pattern
Use options pattern for configuration:
```csharp
public sealed class ServiceOptions
{
public string ConnectionString { get; set; } = string.Empty;
public int Timeout { get; set; } = 30;
}
```
#### Fluent API Design
Many components use fluent interfaces:
```csharp
FluentAspects.Configure(options =>
options.InterceptAll()
.With<LoggingInterceptor>()
);
```
## Testing Guidelines
### Test Structure
- Use xUnit as the testing framework
- Test files should be named `{ComponentName}Test.cs`
- Tests should be in the `WeihanLi.Common.Test` namespace
- Use descriptive test method names that explain the scenario
### Test Patterns
```csharp
[Fact]
public void MethodName_Scenario_ExpectedResult()
{
// Arrange
var input = "test";
// Act
var result = SystemUnderTest.Process(input);
// Assert
Assert.NotNull(result);
}
[Theory]
[InlineData("input1", "expected1")]
[InlineData("input2", "expected2")]
public void MethodName_MultipleInputs_ReturnsExpected(string input, string expected)
{
var result = SystemUnderTest.Process(input);
Assert.Equal(expected, result);
}
```
## Build and Development
### Build System
- Uses .NET 10 SDK
- Custom build scripts in `build/` directory using dotnet-execute
- Multi-targeting for compatibility across .NET versions
- Automated CI/CD with GitHub Actions and Azure DevOps
### .NET SDK Setup
The project requires .NET 10 SDK (with rollForward enabled to support newer versions). For development setup:
1. **Install .NET SDK**: Download and install .NET 10 SDK or later from [dotnet.microsoft.com](https://dotnet.microsoft.com/download)
2. **Multiple SDK Versions**: The GitHub Actions workflow (`.github/workflows/default.yml`) shows the supported SDK versions:
```yaml
dotnet-version: |
8.0.x
9.0.x
10.0.x
```
3. **Verify Installation**: Run `dotnet --info` to confirm the SDK is properly installed
4. **SDK Configuration**: The `global.json` file specifies the minimum SDK version with `rollForward: "latestMajor"` enabled
### Development Commands
```bash
# Build the solution
dotnet build
# Run tests
dotnet test
# Run custom build script
dotnet build.cs
# Format code
dotnet format
```
### Code Generation
Some files are generated using T4 templates (.tt files):
- Database extension methods
- Service container registration methods
## Common Tasks
### Adding New Extensions
1. Create extension class in appropriate `Extensions/` subdirectory
2. Use proper namespace (typically `WeihanLi.Extensions`)
3. Add comprehensive XML documentation
4. Write corresponding unit tests
5. Follow existing patterns for parameter validation
### Adding New Services
1. Define interface in `Abstractions/` if needed
2. Implement service in `Services/` directory
3. Add configuration options class if configurable
4. Register with DI container if applicable
5. Add integration tests
### Working with AOP
The Fluent Aspects framework allows method interception:
```csharp
// Configure interceptors
FluentAspects.Configure(options =>
{
options.InterceptMethod<IService>(s => s.Process(Argument.Any<string>()))
.With<ValidationInterceptor>();
});
// Create proxy
var service = FluentAspects.AspectOptions.ProxyFactory
.CreateProxy<IService>(new ServiceImplementation());
```
### Database Operations
Use the data extensions for database operations:
```csharp
// Query data
var users = connection.Select<User>("SELECT * FROM Users WHERE Age > @age", new { age = 18 });
// Repository pattern
var repository = new Repository<User>(() => connectionFactory.GetConnection());
var user = repository.Fetch(u => u.Id == userId);
```
## Dependencies and Compatibility
### Key Dependencies
- Microsoft.Extensions.Configuration
- Microsoft.Extensions.Logging
- Newtonsoft.Json
- System.ComponentModel.Annotations (for .NET Standard 2.0)
### Compatibility Notes
- Supports .NET Standard 2.0 for broad compatibility
- Modern .NET versions (8.0+) for latest features
- Conditional compilation for framework-specific optimizations
- AOT compatibility for .NET 8.0+
## Documentation
- XML documentation is required for all public APIs
- Use DocFX for generating documentation website
- Examples should be provided in the `samples/` directory
- README files should be updated when adding major features
## Performance Considerations
- Use `Span<T>` and `Memory<T>` where appropriate for modern .NET versions
- Avoid allocations in hot paths
- Use object pooling for frequently allocated objects
- Benchmark performance-critical code in `perf/` directory
## Security Guidelines
- Input validation using Guard utilities
- Proper disposal of resources
- Secure random number generation for cryptographic operations
- Avoid hardcoded secrets or credentials
## Contributing Guidelines
When contributing to this repository:
1. Follow existing code style and patterns
2. Add comprehensive tests for new functionality
3. Update documentation and examples
4. Ensure compatibility across target frameworks
5. Use conventional commit messages
6. Consider performance implications
7. Validate with existing build and test processes
================================================
FILE: .devcontainer/devcontainer.json
================================================
{
"name": "CodeSpace",
"image": "mcr.microsoft.com/devcontainers/base:debian",
"postCreateCommand": "bash -i ${containerWorkspaceFolder}/.devcontainer/scripts/post-creation.sh",
// features list: https://containers.dev/features
"features": {
"ghcr.io/devcontainers/features/git:1": {},
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
"ghcr.io/devcontainers/features/dotnet:2": {
"version": "latest",
"additionalVersions": "lts"
}
},
"customizations": {
"vscode": {
"extensions": [
"ms-dotnettools.csdevkit",
"EditorConfig.EditorConfig",
"DavidAnson.vscode-markdownlint"
]
}
}
}
================================================
FILE: .devcontainer/scripts/post-creation.sh
================================================
dotnet tool install -g dotnet-execute --prereleaase
dotnet tool install -g dotnet-httpie
dotnet restore
================================================
FILE: .editorconfig
================================================
# EditorConfig is awesome:http://EditorConfig.org
# top-most EditorConfig file
root = true
# Don't use tabs for indentation.
[*]
indent_style = space
# (Please don't specify an indent_size here; that has too many unintended consequences.)
# Code files
[*.{cs,csx,vb,vbx}]
indent_size = 4
insert_final_newline = true
charset = utf-8-bom
# Xml project files
[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj}]
indent_size = 2
# Xml config files
[*.{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct}]
indent_size = 2
# JSON files
[*.json]
indent_size = 2
# Dotnet code style settings:
[*.{cs,vb}]
# File header
file_header_template = Copyright (c) Weihan Li. All rights reserved.\nLicensed under the Apache license.
# Sort using and Import directives with System.* appearing first
dotnet_sort_system_directives_first = false
# Avoid "this." and "Me." if not necessary
dotnet_style_qualification_for_field = false:suggestion
dotnet_style_qualification_for_property = false:suggestion
dotnet_style_qualification_for_method = false:suggestion
dotnet_style_qualification_for_event = false:suggestion
# Use language keywords instead of framework type names for type references
dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
dotnet_style_predefined_type_for_member_access = true:suggestion
# Suggest more modern language features when available
dotnet_style_object_initializer = true:suggestion
dotnet_style_collection_initializer = true:suggestion
dotnet_style_coalesce_expression = true:suggestion
dotnet_style_null_propagation = true:suggestion
dotnet_style_explicit_tuple_names = true:suggestion
# CSharp code style settings:
[*.cs]
# namespace style
csharp_style_namespace_declarations=file_scoped:warning
# Prefer "var" everywhere
csharp_style_var_for_built_in_types = true:suggestion
csharp_style_var_when_type_is_apparent = true:suggestion
csharp_style_var_elsewhere = true:suggestion
# Prefer method-like constructs to have a block body
csharp_style_expression_bodied_methods = false:none
csharp_style_expression_bodied_constructors = false:none
csharp_style_expression_bodied_operators = false:none
# Prefer property-like constructs to have an expression-body
csharp_style_expression_bodied_properties = true:none
csharp_style_expression_bodied_indexers = true:none
csharp_style_expression_bodied_accessors = true:none
# Suggest more modern language features when available
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
csharp_style_inlined_variable_declaration = true:suggestion
csharp_style_throw_expression = true:suggestion
csharp_style_conditional_delegate_call = true:suggestion
# Newline settings
csharp_new_line_before_open_brace = all
csharp_new_line_before_else = true
csharp_new_line_before_catch = true
csharp_new_line_before_finally = true
csharp_new_line_before_members_in_object_initializers = true
csharp_new_line_before_members_in_anonymous_types = true
# Shell scripts
[*.sh]
end_of_line=lf
[*.{cmd, bat}]
end_of_line=crlf
# https://github.com/dotnet/runtime/blob/main/eng/CodeAnalysis.src.globalconfig
# AD0001: Analyzer threw an exception
dotnet_diagnostic.AD0001.severity = suggestion
# BCL0001: Ensure minimum API surface is respected
dotnet_diagnostic.BCL0001.severity = warning
# BCL0010: AppContext default value expected to be true
dotnet_diagnostic.BCL0010.severity = warning
# BCL0011: AppContext default value defined in if statement with incorrect pattern
dotnet_diagnostic.BCL0011.severity = warning
# BCL0012: AppContext default value defined in if statement at root of switch case
dotnet_diagnostic.BCL0012.severity = warning
# BCL0015: Invalid P/Invoke call
dotnet_diagnostic.BCL0015.severity = none
# BCL0020: Invalid SR.Format call
dotnet_diagnostic.BCL0020.severity = warning
# CA1000: Do not declare static members on generic types
dotnet_diagnostic.CA1000.severity = none
# CA1001: Types that own disposable fields should be disposable
dotnet_diagnostic.CA1001.severity = none
# CA1002: Do not expose generic lists
dotnet_diagnostic.CA1002.severity = none
# CA1003: Use generic event handler instances
dotnet_diagnostic.CA1003.severity = none
# CA1005: Avoid excessive parameters on generic types
dotnet_diagnostic.CA1005.severity = none
# CA1008: Enums should have zero value
dotnet_diagnostic.CA1008.severity = none
# CA1010: Generic interface should also be implemented
dotnet_diagnostic.CA1010.severity = none
# CA1012: Abstract types should not have public constructors
dotnet_diagnostic.CA1012.severity = none
# CA1014: Mark assemblies with CLSCompliant
dotnet_diagnostic.CA1014.severity = none
# CA1016: Mark assemblies with assembly version
dotnet_diagnostic.CA1016.severity = none
# CA1017: Mark assemblies with ComVisible
dotnet_diagnostic.CA1017.severity = none
# CA1018: Mark attributes with AttributeUsageAttribute
dotnet_diagnostic.CA1018.severity = warning
# CA1019: Define accessors for attribute arguments
dotnet_diagnostic.CA1019.severity = none
# CA1021: Avoid out parameters
dotnet_diagnostic.CA1021.severity = none
# CA1024: Use properties where appropriate
dotnet_diagnostic.CA1024.severity = none
# CA1027: Mark enums with FlagsAttribute
dotnet_diagnostic.CA1027.severity = none
# CA1028: Enum Storage should be Int32
dotnet_diagnostic.CA1028.severity = none
# CA1030: Use events where appropriate
dotnet_diagnostic.CA1030.severity = none
# CA1031: Do not catch general exception types
dotnet_diagnostic.CA1031.severity = none
# CA1032: Implement standard exception constructors
dotnet_diagnostic.CA1032.severity = none
# CA1033: Interface methods should be callable by child types
dotnet_diagnostic.CA1033.severity = none
# CA1034: Nested types should not be visible
dotnet_diagnostic.CA1034.severity = none
# CA1036: Override methods on comparable types
dotnet_diagnostic.CA1036.severity = none
# CA1040: Avoid empty interfaces
dotnet_diagnostic.CA1040.severity = none
# CA1041: Provide ObsoleteAttribute message
dotnet_diagnostic.CA1041.severity = none
# CA1043: Use Integral Or String Argument For Indexers
dotnet_diagnostic.CA1043.severity = none
# CA1044: Properties should not be write only
dotnet_diagnostic.CA1044.severity = none
# CA1045: Do not pass types by reference
dotnet_diagnostic.CA1045.severity = none
# CA1046: Do not overload equality operator on reference types
dotnet_diagnostic.CA1046.severity = none
# CA1047: Do not declare protected member in sealed type
dotnet_diagnostic.CA1047.severity = warning
# CA1050: Declare types in namespaces
dotnet_diagnostic.CA1050.severity = warning
# CA1051: Do not declare visible instance fields
dotnet_diagnostic.CA1051.severity = none
# CA1052: Static holder types should be Static or NotInheritable
dotnet_diagnostic.CA1052.severity = warning
dotnet_code_quality.CA1052.api_surface = private, internal
# CA1054: URI-like parameters should not be strings
dotnet_diagnostic.CA1054.severity = none
# CA1055: URI-like return values should not be strings
dotnet_diagnostic.CA1055.severity = none
# CA1056: URI-like properties should not be strings
dotnet_diagnostic.CA1056.severity = none
# CA1058: Types should not extend certain base types
dotnet_diagnostic.CA1058.severity = none
# CA1060: Move pinvokes to native methods class
dotnet_diagnostic.CA1060.severity = none
# CA1061: Do not hide base class methods
dotnet_diagnostic.CA1061.severity = none
# CA1062: Validate arguments of public methods
dotnet_diagnostic.CA1062.severity = none
# CA1063: Implement IDisposable Correctly
dotnet_diagnostic.CA1063.severity = none
# CA1064: Exceptions should be public
dotnet_diagnostic.CA1064.severity = none
# CA1065: Do not raise exceptions in unexpected locations
dotnet_diagnostic.CA1065.severity = none
# CA1066: Implement IEquatable when overriding Object.Equals
dotnet_diagnostic.CA1066.severity = warning
# CA1067: Override Object.Equals(object) when implementing IEquatable<T>
dotnet_diagnostic.CA1067.severity = warning
# CA1068: CancellationToken parameters must come last
dotnet_diagnostic.CA1068.severity = none
# CA1069: Enums values should not be duplicated
dotnet_diagnostic.CA1069.severity = none
# CA1070: Do not declare event fields as virtual
dotnet_diagnostic.CA1070.severity = suggestion
# CA1200: Avoid using cref tags with a prefix
dotnet_diagnostic.CA1200.severity = suggestion
# CA1303: Do not pass literals as localized parameters
dotnet_diagnostic.CA1303.severity = none
# CA1304: Specify CultureInfo
dotnet_diagnostic.CA1304.severity = none
# CA1305: Specify IFormatProvider
dotnet_diagnostic.CA1305.severity = none
# CA1307: Specify StringComparison for clarity
dotnet_diagnostic.CA1307.severity = none
# CA1308: Normalize strings to uppercase
dotnet_diagnostic.CA1308.severity = none
# CA1309: Use ordinal string comparison
dotnet_diagnostic.CA1309.severity = none
# CA1310: Specify StringComparison for correctness
dotnet_diagnostic.CA1310.severity = suggestion
# CA1311: Specify a culture or use an invariant version
dotnet_diagnostic.CA1311.severity = warning
# CA1401: P/Invokes should not be visible
dotnet_diagnostic.CA1401.severity = warning
# CA1416: Validate platform compatibility
dotnet_diagnostic.CA1416.severity = warning
# CA1417: Do not use 'OutAttribute' on string parameters for P/Invokes
dotnet_diagnostic.CA1417.severity = warning
# CA1418: Use valid platform string
dotnet_diagnostic.CA1418.severity = warning
# CA1419: Provide a parameterless constructor that is as visible as the containing type for concrete types derived from 'System.Runtime.InteropServices.SafeHandle'
dotnet_diagnostic.CA1419.severity = warning
# CA1420: Property, type, or attribute requires runtime marshalling
dotnet_diagnostic.CA1420.severity = warning
# CA1421: This method uses runtime marshalling even when the 'DisableRuntimeMarshallingAttribute' is applied
dotnet_diagnostic.CA1421.severity = suggestion
# CA1501: Avoid excessive inheritance
dotnet_diagnostic.CA1501.severity = none
# CA1502: Avoid excessive complexity
dotnet_diagnostic.CA1502.severity = none
# CA1505: Avoid unmaintainable code
dotnet_diagnostic.CA1505.severity = none
# CA1506: Avoid excessive class coupling
dotnet_diagnostic.CA1506.severity = none
# CA1507: Use nameof to express symbol names
dotnet_diagnostic.CA1507.severity = warning
# CA1508: Avoid dead conditional code
dotnet_diagnostic.CA1508.severity = none
# CA1509: Invalid entry in code metrics rule specification file
dotnet_diagnostic.CA1509.severity = none
# CA1700: Do not name enum values 'Reserved'
dotnet_diagnostic.CA1700.severity = none
# CA1707: Identifiers should not contain underscores
dotnet_diagnostic.CA1707.severity = none
# CA1708: Identifiers should differ by more than case
dotnet_diagnostic.CA1708.severity = none
# CA1710: Identifiers should have correct suffix
dotnet_diagnostic.CA1710.severity = none
# CA1711: Identifiers should not have incorrect suffix
dotnet_diagnostic.CA1711.severity = none
# CA1712: Do not prefix enum values with type name
dotnet_diagnostic.CA1712.severity = none
# CA1713: Events should not have 'Before' or 'After' prefix
dotnet_diagnostic.CA1713.severity = none
# CA1715: Identifiers should have correct prefix
dotnet_diagnostic.CA1715.severity = none
# CA1716: Identifiers should not match keywords
dotnet_diagnostic.CA1716.severity = none
# CA1720: Identifier contains type name
dotnet_diagnostic.CA1720.severity = none
# CA1721: Property names should not match get methods
dotnet_diagnostic.CA1721.severity = none
# CA1724: Type names should not match namespaces
dotnet_diagnostic.CA1724.severity = none
# CA1725: Parameter names should match base declaration
dotnet_diagnostic.CA1725.severity = suggestion
# CA1727: Use PascalCase for named placeholders
dotnet_diagnostic.CA1727.severity = suggestion
# CA1802: Use literals where appropriate
dotnet_diagnostic.CA1802.severity = warning
dotnet_code_quality.CA1802.api_surface = private, internal
# CA1805: Do not initialize unnecessarily
dotnet_diagnostic.CA1805.severity = warning
# CA1806: Do not ignore method results
dotnet_diagnostic.CA1806.severity = none
# CA1810: Initialize reference type static fields inline
dotnet_diagnostic.CA1810.severity = warning
# CA1812: Avoid uninstantiated internal classes
dotnet_diagnostic.CA1812.severity = none
# CA1813: Avoid unsealed attributes
dotnet_diagnostic.CA1813.severity = none
# CA1814: Prefer jagged arrays over multidimensional
dotnet_diagnostic.CA1814.severity = none
# CA1815: Override equals and operator equals on value types
dotnet_diagnostic.CA1815.severity = none
# CA1816: Dispose methods should call SuppressFinalize
dotnet_diagnostic.CA1816.severity = none
# CA1819: Properties should not return arrays
dotnet_diagnostic.CA1819.severity = none
# CA1820: Test for empty strings using string length
dotnet_diagnostic.CA1820.severity = none
# CA1821: Remove empty Finalizers
dotnet_diagnostic.CA1821.severity = warning
# CA1822: Mark members as static
dotnet_diagnostic.CA1822.severity = warning
dotnet_code_quality.CA1822.api_surface = private, internal
# CA1823: Avoid unused private fields
dotnet_diagnostic.CA1823.severity = warning
# CA1824: Mark assemblies with NeutralResourcesLanguageAttribute
dotnet_diagnostic.CA1824.severity = warning
# CA1825: Avoid zero-length array allocations
dotnet_diagnostic.CA1825.severity = warning
# CA1826: Do not use Enumerable methods on indexable collections
dotnet_diagnostic.CA1826.severity = warning
# CA1827: Do not use Count() or LongCount() when Any() can be used
dotnet_diagnostic.CA1827.severity = warning
# CA1828: Do not use CountAsync() or LongCountAsync() when AnyAsync() can be used
dotnet_diagnostic.CA1828.severity = warning
# CA1829: Use Length/Count property instead of Count() when available
dotnet_diagnostic.CA1829.severity = warning
# CA1830: Prefer strongly-typed Append and Insert method overloads on StringBuilder
dotnet_diagnostic.CA1830.severity = warning
# CA1831: Use AsSpan or AsMemory instead of Range-based indexers when appropriate
dotnet_diagnostic.CA1831.severity = warning
# CA1832: Use AsSpan or AsMemory instead of Range-based indexers when appropriate
dotnet_diagnostic.CA1832.severity = warning
# CA1833: Use AsSpan or AsMemory instead of Range-based indexers when appropriate
dotnet_diagnostic.CA1833.severity = warning
# CA1834: Consider using 'StringBuilder.Append(char)' when applicable
dotnet_diagnostic.CA1834.severity = warning
# CA1835: Prefer the 'Memory'-based overloads for 'ReadAsync' and 'WriteAsync'
dotnet_diagnostic.CA1835.severity = warning
# CA1836: Prefer IsEmpty over Count
dotnet_diagnostic.CA1836.severity = warning
# CA1837: Use 'Environment.ProcessId'
dotnet_diagnostic.CA1837.severity = warning
# CA1838: Avoid 'StringBuilder' parameters for P/Invokes
dotnet_diagnostic.CA1838.severity = warning
# CA1839: Use 'Environment.ProcessPath'
dotnet_diagnostic.CA1839.severity = warning
# CA1840: Use 'Environment.CurrentManagedThreadId'
dotnet_diagnostic.CA1840.severity = warning
# CA1841: Prefer Dictionary.Contains methods
dotnet_diagnostic.CA1841.severity = warning
# CA1842: Do not use 'WhenAll' with a single task
dotnet_diagnostic.CA1842.severity = warning
# CA1843: Do not use 'WaitAll' with a single task
dotnet_diagnostic.CA1843.severity = warning
# CA1844: Provide memory-based overrides of async methods when subclassing 'Stream'
dotnet_diagnostic.CA1844.severity = warning
# CA1845: Use span-based 'string.Concat'
dotnet_diagnostic.CA1845.severity = warning
# CA1846: Prefer 'AsSpan' over 'Substring'
dotnet_diagnostic.CA1846.severity = warning
# CA1847: Use char literal for a single character lookup
dotnet_diagnostic.CA1847.severity = warning
# CA1848: Use the LoggerMessage delegates
dotnet_diagnostic.CA1848.severity = none
# CA1849: Call async methods when in an async method
dotnet_diagnostic.CA1849.severity = suggestion
# CA1850: Prefer static 'HashData' method over 'ComputeHash'
dotnet_diagnostic.CA1850.severity = warning
# CA1851: Possible multiple enumerations of 'IEnumerable' collection
dotnet_diagnostic.CA1851.severity = suggestion
# CA1852: Seal internal types
dotnet_diagnostic.CA1852.severity = warning
# CA1853: Unnecessary call to 'Dictionary.ContainsKey(key)'
dotnet_diagnostic.CA1853.severity = warning
# CA1854: Prefer the 'IDictionary.TryGetValue(TKey, out TValue)' method
dotnet_diagnostic.CA1854.severity = warning
# CA2000: Dispose objects before losing scope
dotnet_diagnostic.CA2000.severity = none
# CA2002: Do not lock on objects with weak identity
dotnet_diagnostic.CA2002.severity = none
# CA2007: Consider calling ConfigureAwait on the awaited task
dotnet_diagnostic.CA2007.severity = warning
# CA2008: Do not create tasks without passing a TaskScheduler
dotnet_diagnostic.CA2008.severity = warning
# CA2009: Do not call ToImmutableCollection on an ImmutableCollection value
dotnet_diagnostic.CA2009.severity = warning
# CA2011: Avoid infinite recursion
dotnet_diagnostic.CA2011.severity = warning
# CA2012: Use ValueTasks correctly
dotnet_diagnostic.CA2012.severity = warning
# CA2013: Do not use ReferenceEquals with value types
dotnet_diagnostic.CA2013.severity = warning
# CA2014: Do not use stackalloc in loops
dotnet_diagnostic.CA2014.severity = warning
# CA2015: Do not define finalizers for types derived from MemoryManager<T>
dotnet_diagnostic.CA2015.severity = warning
# CA2016: Forward the 'CancellationToken' parameter to methods
dotnet_diagnostic.CA2016.severity = warning
# CA2017: Parameter count mismatch
dotnet_diagnostic.CA2017.severity = warning
# CA2018: 'Buffer.BlockCopy' expects the number of bytes to be copied for the 'count' argument
dotnet_diagnostic.CA2018.severity = warning
# CA2019: Improper 'ThreadStatic' field initialization
dotnet_diagnostic.CA2019.severity = warning
# CA2100: Review SQL queries for security vulnerabilities
dotnet_diagnostic.CA2100.severity = none
# CA2101: Specify marshaling for P/Invoke string arguments
dotnet_diagnostic.CA2101.severity = none
# CA2109: Review visible event handlers
dotnet_diagnostic.CA2109.severity = none
# CA2119: Seal methods that satisfy private interfaces
dotnet_diagnostic.CA2119.severity = none
# CA2153: Do Not Catch Corrupted State Exceptions
dotnet_diagnostic.CA2153.severity = none
# CA2200: Rethrow to preserve stack details
dotnet_diagnostic.CA2200.severity = warning
# CA2201: Do not raise reserved exception types
dotnet_diagnostic.CA2201.severity = none
# CA2207: Initialize value type static fields inline
dotnet_diagnostic.CA2207.severity = warning
# CA2208: Instantiate argument exceptions correctly
dotnet_diagnostic.CA2208.severity = warning
dotnet_code_quality.CA2208.api_surface = public
# CA2211: Non-constant fields should not be visible
dotnet_diagnostic.CA2211.severity = none
# CA2213: Disposable fields should be disposed
dotnet_diagnostic.CA2213.severity = none
# CA2214: Do not call overridable methods in constructors
dotnet_diagnostic.CA2214.severity = none
# CA2215: Dispose methods should call base class dispose
dotnet_diagnostic.CA2215.severity = none
# CA2216: Disposable types should declare finalizer
dotnet_diagnostic.CA2216.severity = none
# CA2217: Do not mark enums with FlagsAttribute
dotnet_diagnostic.CA2217.severity = none
# CA2218: Override GetHashCode on overriding Equals
dotnet_diagnostic.CA2218.severity = none
# CA2219: Do not raise exceptions in finally clauses
dotnet_diagnostic.CA2219.severity = none
# CA2224: Override Equals on overloading operator equals
dotnet_diagnostic.CA2224.severity = none
# CA2225: Operator overloads have named alternates
dotnet_diagnostic.CA2225.severity = none
# CA2226: Operators should have symmetrical overloads
dotnet_diagnostic.CA2226.severity = none
# CA2227: Collection properties should be read only
dotnet_diagnostic.CA2227.severity = none
# CA2229: Implement serialization constructors
dotnet_diagnostic.CA2229.severity = warning
# CA2231: Overload operator equals on overriding value type Equals
dotnet_diagnostic.CA2231.severity = none
# CA2234: Pass system uri objects instead of strings
dotnet_diagnostic.CA2234.severity = none
# CA2235: Mark all non-serializable fields
dotnet_diagnostic.CA2235.severity = none
# CA2237: Mark ISerializable types with serializable
dotnet_diagnostic.CA2237.severity = none
# CA2241: Provide correct arguments to formatting methods
dotnet_diagnostic.CA2241.severity = warning
# CA2242: Test for NaN correctly
dotnet_diagnostic.CA2242.severity = warning
# CA2243: Attribute string literals should parse correctly
dotnet_diagnostic.CA2243.severity = warning
# CA2244: Do not duplicate indexed element initializations
dotnet_diagnostic.CA2244.severity = warning
# CA2245: Do not assign a property to itself
dotnet_diagnostic.CA2245.severity = warning
# CA2246: Assigning symbol and its member in the same statement
dotnet_diagnostic.CA2246.severity = warning
# CA2247: Argument passed to TaskCompletionSource constructor should be TaskCreationOptions enum instead of TaskContinuationOptions enum
dotnet_diagnostic.CA2247.severity = warning
# CA2248: Provide correct 'enum' argument to 'Enum.HasFlag'
dotnet_diagnostic.CA2248.severity = warning
# CA2249: Consider using 'string.Contains' instead of 'string.IndexOf'
dotnet_diagnostic.CA2249.severity = warning
# CA2250: Use 'ThrowIfCancellationRequested'
dotnet_diagnostic.CA2250.severity = warning
# CA2251: Use 'string.Equals'
dotnet_diagnostic.CA2251.severity = warning
# CA2252: This API requires opting into preview features
dotnet_diagnostic.CA2252.severity = error
# CA2253: Named placeholders should not be numeric values
dotnet_diagnostic.CA2253.severity = none
# CA2254: Template should be a static expression
dotnet_diagnostic.CA2254.severity = none
# CA2255: The 'ModuleInitializer' attribute should not be used in libraries
dotnet_diagnostic.CA2255.severity = warning
# CA2256: All members declared in parent interfaces must have an implementation in a DynamicInterfaceCastableImplementation-attributed interface
dotnet_diagnostic.CA2256.severity = warning
# CA2257: Members defined on an interface with the 'DynamicInterfaceCastableImplementationAttribute' should be 'static'
dotnet_diagnostic.CA2257.severity = warning
# CA2258: Providing a 'DynamicInterfaceCastableImplementation' interface in Visual Basic is unsupported
dotnet_diagnostic.CA2258.severity = warning
# CA2259: 'ThreadStatic' only affects static fields
dotnet_diagnostic.CA2259.severity = warning
# CA2300: Do not use insecure deserializer BinaryFormatter
dotnet_diagnostic.CA2300.severity = none
# CA2301: Do not call BinaryFormatter.Deserialize without first setting BinaryFormatter.Binder
dotnet_diagnostic.CA2301.severity = none
# CA2302: Ensure BinaryFormatter.Binder is set before calling BinaryFormatter.Deserialize
dotnet_diagnostic.CA2302.severity = none
# CA2305: Do not use insecure deserializer LosFormatter
dotnet_diagnostic.CA2305.severity = none
# CA2310: Do not use insecure deserializer NetDataContractSerializer
dotnet_diagnostic.CA2310.severity = none
# CA2311: Do not deserialize without first setting NetDataContractSerializer.Binder
dotnet_diagnostic.CA2311.severity = none
# CA2312: Ensure NetDataContractSerializer.Binder is set before deserializing
dotnet_diagnostic.CA2312.severity = none
# CA2315: Do not use insecure deserializer ObjectStateFormatter
dotnet_diagnostic.CA2315.severity = none
# CA2321: Do not deserialize with JavaScriptSerializer using a SimpleTypeResolver
dotnet_diagnostic.CA2321.severity = none
# CA2322: Ensure JavaScriptSerializer is not initialized with SimpleTypeResolver before deserializing
dotnet_diagnostic.CA2322.severity = none
# CA2326: Do not use TypeNameHandling values other than None
dotnet_diagnostic.CA2326.severity = none
# CA2327: Do not use insecure JsonSerializerSettings
dotnet_diagnostic.CA2327.severity = none
# CA2328: Ensure that JsonSerializerSettings are secure
dotnet_diagnostic.CA2328.severity = none
# CA2329: Do not deserialize with JsonSerializer using an insecure configuration
dotnet_diagnostic.CA2329.severity = none
# CA2330: Ensure that JsonSerializer has a secure configuration when deserializing
dotnet_diagnostic.CA2330.severity = none
# CA2350: Do not use DataTable.ReadXml() with untrusted data
dotnet_diagnostic.CA2350.severity = none
# CA2351: Do not use DataSet.ReadXml() with untrusted data
dotnet_diagnostic.CA2351.severity = none
# CA2352: Unsafe DataSet or DataTable in serializable type can be vulnerable to remote code execution attacks
dotnet_diagnostic.CA2352.severity = none
# CA2353: Unsafe DataSet or DataTable in serializable type
dotnet_diagnostic.CA2353.severity = none
# CA2354: Unsafe DataSet or DataTable in deserialized object graph can be vulnerable to remote code execution attacks
dotnet_diagnostic.CA2354.severity = none
# CA2355: Unsafe DataSet or DataTable type found in deserializable object graph
dotnet_diagnostic.CA2355.severity = none
# CA2356: Unsafe DataSet or DataTable type in web deserializable object graph
dotnet_diagnostic.CA2356.severity = none
# CA2361: Ensure auto-generated class containing DataSet.ReadXml() is not used with untrusted data
dotnet_diagnostic.CA2361.severity = none
# CA2362: Unsafe DataSet or DataTable in auto-generated serializable type can be vulnerable to remote code execution attacks
dotnet_diagnostic.CA2362.severity = none
# CA3001: Review code for SQL injection vulnerabilities
dotnet_diagnostic.CA3001.severity = none
# CA3002: Review code for XSS vulnerabilities
dotnet_diagnostic.CA3002.severity = none
# CA3003: Review code for file path injection vulnerabilities
dotnet_diagnostic.CA3003.severity = none
# CA3004: Review code for information disclosure vulnerabilities
dotnet_diagnostic.CA3004.severity = none
# CA3005: Review code for LDAP injection vulnerabilities
dotnet_diagnostic.CA3005.severity = none
# CA3006: Review code for process command injection vulnerabilities
dotnet_diagnostic.CA3006.severity = none
# CA3007: Review code for open redirect vulnerabilities
dotnet_diagnostic.CA3007.severity = none
# CA3008: Review code for XPath injection vulnerabilities
dotnet_diagnostic.CA3008.severity = none
# CA3009: Review code for XML injection vulnerabilities
dotnet_diagnostic.CA3009.severity = none
# CA3010: Review code for XAML injection vulnerabilities
dotnet_diagnostic.CA3010.severity = none
# CA3011: Review code for DLL injection vulnerabilities
dotnet_diagnostic.CA3011.severity = none
# CA3012: Review code for regex injection vulnerabilities
dotnet_diagnostic.CA3012.severity = none
# CA3061: Do Not Add Schema By URL
dotnet_diagnostic.CA3061.severity = warning
# CA3075: Insecure DTD processing in XML
dotnet_diagnostic.CA3075.severity = warning
# CA3076: Insecure XSLT script processing.
dotnet_diagnostic.CA3076.severity = warning
# CA3077: Insecure Processing in API Design, XmlDocument and XmlTextReader
dotnet_diagnostic.CA3077.severity = warning
# CA3147: Mark Verb Handlers With Validate Antiforgery Token
dotnet_diagnostic.CA3147.severity = warning
# CA5350: Do Not Use Weak Cryptographic Algorithms
dotnet_diagnostic.CA5350.severity = warning
# CA5351: Do Not Use Broken Cryptographic Algorithms
dotnet_diagnostic.CA5351.severity = warning
# CA5358: Review cipher mode usage with cryptography experts
dotnet_diagnostic.CA5358.severity = none
# CA5359: Do Not Disable Certificate Validation
dotnet_diagnostic.CA5359.severity = warning
# CA5360: Do Not Call Dangerous Methods In Deserialization
dotnet_diagnostic.CA5360.severity = warning
# CA5361: Do Not Disable SChannel Use of Strong Crypto
dotnet_diagnostic.CA5361.severity = warning
# CA5362: Potential reference cycle in deserialized object graph
dotnet_diagnostic.CA5362.severity = none
# CA5363: Do Not Disable Request Validation
dotnet_diagnostic.CA5363.severity = warning
# CA5364: Do Not Use Deprecated Security Protocols
dotnet_diagnostic.CA5364.severity = warning
# CA5365: Do Not Disable HTTP Header Checking
dotnet_diagnostic.CA5365.severity = warning
# CA5366: Use XmlReader for 'DataSet.ReadXml()'
dotnet_diagnostic.CA5366.severity = none
# CA5367: Do Not Serialize Types With Pointer Fields
dotnet_diagnostic.CA5367.severity = none
# CA5368: Set ViewStateUserKey For Classes Derived From Page
dotnet_diagnostic.CA5368.severity = warning
# CA5369: Use XmlReader for 'XmlSerializer.Deserialize()'
dotnet_diagnostic.CA5369.severity = none
# CA5370: Use XmlReader for XmlValidatingReader constructor
dotnet_diagnostic.CA5370.severity = warning
# CA5371: Use XmlReader for 'XmlSchema.Read()'
dotnet_diagnostic.CA5371.severity = none
# CA5372: Use XmlReader for XPathDocument constructor
dotnet_diagnostic.CA5372.severity = none
# CA5373: Do not use obsolete key derivation function
dotnet_diagnostic.CA5373.severity = warning
# CA5374: Do Not Use XslTransform
dotnet_diagnostic.CA5374.severity = warning
# CA5375: Do Not Use Account Shared Access Signature
dotnet_diagnostic.CA5375.severity = none
# CA5376: Use SharedAccessProtocol HttpsOnly
dotnet_diagnostic.CA5376.severity = warning
# CA5377: Use Container Level Access Policy
dotnet_diagnostic.CA5377.severity = warning
# CA5378: Do not disable ServicePointManagerSecurityProtocols
dotnet_diagnostic.CA5378.severity = warning
# CA5379: Ensure Key Derivation Function algorithm is sufficiently strong
dotnet_diagnostic.CA5379.severity = warning
# CA5380: Do Not Add Certificates To Root Store
dotnet_diagnostic.CA5380.severity = warning
# CA5381: Ensure Certificates Are Not Added To Root Store
dotnet_diagnostic.CA5381.severity = warning
# CA5382: Use Secure Cookies In ASP.NET Core
dotnet_diagnostic.CA5382.severity = none
# CA5383: Ensure Use Secure Cookies In ASP.NET Core
dotnet_diagnostic.CA5383.severity = none
# CA5384: Do Not Use Digital Signature Algorithm (DSA)
dotnet_diagnostic.CA5384.severity = warning
# CA5385: Use Rivest-Shamir-Adleman (RSA) Algorithm With Sufficient Key Size
dotnet_diagnostic.CA5385.severity = warning
# CA5386: Avoid hardcoding SecurityProtocolType value
dotnet_diagnostic.CA5386.severity = none
# CA5387: Do Not Use Weak Key Derivation Function With Insufficient Iteration Count
dotnet_diagnostic.CA5387.severity = none
# CA5388: Ensure Sufficient Iteration Count When Using Weak Key Derivation Function
dotnet_diagnostic.CA5388.severity = none
# CA5389: Do Not Add Archive Item's Path To The Target File System Path
dotnet_diagnostic.CA5389.severity = none
# CA5390: Do not hard-code encryption key
dotnet_diagnostic.CA5390.severity = none
# CA5391: Use antiforgery tokens in ASP.NET Core MVC controllers
dotnet_diagnostic.CA5391.severity = none
# CA5392: Use DefaultDllImportSearchPaths attribute for P/Invokes
dotnet_diagnostic.CA5392.severity = none
# CA5393: Do not use unsafe DllImportSearchPath value
dotnet_diagnostic.CA5393.severity = none
# CA5394: Do not use insecure randomness
dotnet_diagnostic.CA5394.severity = none
# CA5395: Miss HttpVerb attribute for action methods
dotnet_diagnostic.CA5395.severity = none
# CA5396: Set HttpOnly to true for HttpCookie
dotnet_diagnostic.CA5396.severity = none
# CA5397: Do not use deprecated SslProtocols values
dotnet_diagnostic.CA5397.severity = none
# CA5398: Avoid hardcoded SslProtocols values
dotnet_diagnostic.CA5398.severity = none
# CA5399: HttpClients should enable certificate revocation list checks
dotnet_diagnostic.CA5399.severity = none
# CA5400: Ensure HttpClient certificate revocation list check is not disabled
dotnet_diagnostic.CA5400.severity = none
# CA5401: Do not use CreateEncryptor with non-default IV
dotnet_diagnostic.CA5401.severity = none
# CA5402: Use CreateEncryptor with the default IV
dotnet_diagnostic.CA5402.severity = none
# CA5403: Do not hard-code certificate
dotnet_diagnostic.CA5403.severity = none
# CA5404: Do not disable token validation checks
dotnet_diagnostic.CA5404.severity = none
# CA5405: Do not always skip token validation in delegates
dotnet_diagnostic.CA5405.severity = none
# IL3000: Avoid using accessing Assembly file path when publishing as a single-file
dotnet_diagnostic.IL3000.severity = warning
# IL3001: Avoid using accessing Assembly file path when publishing as a single-file
dotnet_diagnostic.IL3001.severity = warning
# IL3002: Using member with RequiresAssemblyFilesAttribute can break functionality when embedded in a single-file app
dotnet_diagnostic.IL3002.severity = warning
# SA0001: XML comments
dotnet_diagnostic.SA0001.severity = none
# SA1000: Spacing around keywords
# suggestion until https://github.com/DotNetAnalyzers/StyleCopAnalyzers/issues/3478 is resolved
dotnet_diagnostic.SA1000.severity = suggestion
# SA1001: Commas should not be preceded by whitespace
dotnet_diagnostic.SA1001.severity = warning
# SA1002: Semicolons should not be preceded by a space
dotnet_diagnostic.SA1002.severity = none
# SA1003: Operator should not appear at the end of a line
dotnet_diagnostic.SA1003.severity = none
# SA1004: Documentation line should begin with a space
dotnet_diagnostic.SA1004.severity = none
# SA1005: Single line comment should begin with a space
dotnet_diagnostic.SA1005.severity = none
# SA1008: Opening parenthesis should not be preceded by a space
dotnet_diagnostic.SA1008.severity = none
# SA1009: Closing parenthesis should not be followed by a space
dotnet_diagnostic.SA1009.severity = none
# SA1010: Opening square brackets should not be preceded by a space
dotnet_diagnostic.SA1010.severity = none
# SA1011: Closing square bracket should be followed by a space
dotnet_diagnostic.SA1011.severity = none
# SA1012: Opening brace should be followed by a space
dotnet_diagnostic.SA1012.severity = none
# SA1013: Closing brace should be preceded by a space
dotnet_diagnostic.SA1013.severity = none
# SA1014: Opening generic brackets should not be preceded by a space
dotnet_diagnostic.SA1014.severity = warning
# SA1015: Closing generic bracket should not be followed by a space
dotnet_diagnostic.SA1015.severity = none
# SA1018: Nullable type symbol should not be preceded by a space
dotnet_diagnostic.SA1018.severity = warning
# SA1020: Increment symbol should not be preceded by a space
dotnet_diagnostic.SA1020.severity = warning
# SA1021: Negative sign should be preceded by a space
dotnet_diagnostic.SA1021.severity = none
# SA1023: Dereference symbol '*' should not be preceded by a space."
dotnet_diagnostic.SA1023.severity = none
# SA1024: Colon should be followed by a space
dotnet_diagnostic.SA1024.severity = none
# SA1025: Code should not contain multiple whitespace characters in a row
dotnet_diagnostic.SA1025.severity = none
# SA1026: Keyword followed by span or blank line
dotnet_diagnostic.SA1026.severity = warning
# SA1027: Tabs and spaces should be used correctly
dotnet_diagnostic.SA1027.severity = warning
# SA1028: Code should not contain trailing whitespace
dotnet_diagnostic.SA1028.severity = warning
# SA1100: Do not prefix calls with base unless local implementation exists
dotnet_diagnostic.SA1100.severity = none
# SA1101: Prefix local calls with this
dotnet_diagnostic.SA1101.severity = none
# SA1102: Query clause should follow previous clause
dotnet_diagnostic.SA1102.severity = warning
# SA1105: Query clauses spanning multiple lines should begin on own line
dotnet_diagnostic.SA1105.severity = warning
# SA1106: Code should not contain empty statements
dotnet_diagnostic.SA1106.severity = none
# SA1107: Code should not contain multiple statements on one line
dotnet_diagnostic.SA1107.severity = none
# SA1108: Block statements should not contain embedded comments
dotnet_diagnostic.SA1108.severity = none
# SA1110: Opening parenthesis or bracket should be on declaration line
dotnet_diagnostic.SA1110.severity = none
# SA1111: Closing parenthesis should be on line of last parameter
dotnet_diagnostic.SA1111.severity = none
# SA1113: Comma should be on the same line as previous parameter
dotnet_diagnostic.SA1113.severity = warning
# SA1114: Parameter list should follow declaration
dotnet_diagnostic.SA1114.severity = none
# SA1115: Parameter should begin on the line after the previous parameter
dotnet_diagnostic.SA1115.severity = warning
# SA1116: Split parameters should start on line after declaration
dotnet_diagnostic.SA1116.severity = none
# SA1117: Parameters should be on same line or separate lines
dotnet_diagnostic.SA1117.severity = none
# SA1118: Parameter should not span multiple lines
dotnet_diagnostic.SA1118.severity = none
# SA1119: Statement should not use unnecessary parenthesis
dotnet_diagnostic.SA1119.severity = none
# SA1120: Comments should contain text
dotnet_diagnostic.SA1120.severity = none
# SA1121: Use built-in type alias
dotnet_diagnostic.SA1121.severity = warning
# SA1122: Use string.Empty for empty strings
dotnet_diagnostic.SA1122.severity = none
# SA1123: Region should not be located within a code element
dotnet_diagnostic.SA1123.severity = none
# SA1124: Do not use regions
dotnet_diagnostic.SA1124.severity = none
# SA1125: Use shorthand for nullable types
dotnet_diagnostic.SA1125.severity = none
# SA1127: Generic type constraints should be on their own line
dotnet_diagnostic.SA1127.severity = none
# SA1128: Put constructor initializers on their own line
dotnet_diagnostic.SA1128.severity = none
# SA1129: Do not use default value type constructor
dotnet_diagnostic.SA1129.severity = warning
# SA1130: Use lambda syntax
dotnet_diagnostic.SA1130.severity = none
# SA1131: Constant values should appear on the right-hand side of comparisons
dotnet_diagnostic.SA1131.severity = none
# SA1132: Do not combine fields
dotnet_diagnostic.SA1132.severity = none
# SA1133: Do not combine attributes
dotnet_diagnostic.SA1133.severity = none
# SA1134: Each attribute should be placed on its own line of code
dotnet_diagnostic.SA1134.severity = none
# SA1135: Using directive should be qualified
dotnet_diagnostic.SA1135.severity = none
# SA1136: Enum values should be on separate lines
dotnet_diagnostic.SA1136.severity = none
# SA1137: Elements should have the same indentation
dotnet_diagnostic.SA1137.severity = none
# SA1139: Use literal suffix notation instead of casting
dotnet_diagnostic.SA1139.severity = none
# SA1141: Use tuple syntax
dotnet_diagnostic.SA1141.severity = warning
# SA1142: Refer to tuple elements by name
dotnet_diagnostic.SA1142.severity = warning
# SA1200: Using directive should appear within a namespace declaration
dotnet_diagnostic.SA1200.severity = none
# SA1201: Elements should appear in the correct order
dotnet_diagnostic.SA1201.severity = none
# SA1202: Elements should be ordered by access
dotnet_diagnostic.SA1202.severity = none
# SA1203: Constants should appear before fields
dotnet_diagnostic.SA1203.severity = none
# SA1204: Static elements should appear before instance elements
dotnet_diagnostic.SA1204.severity = none
# SA1205: Partial elements should declare an access modifier
dotnet_diagnostic.SA1205.severity = warning
# SA1206: Keyword ordering - TODO Re-enable as warning after https://github.com/DotNetAnalyzers/StyleCopAnalyzers/issues/3527
dotnet_diagnostic.SA1206.severity = suggestion
# SA1208: Using directive ordering
dotnet_diagnostic.SA1208.severity = none
# SA1209: Using alias directives should be placed after all using namespace directives
dotnet_diagnostic.SA1209.severity = none
# SA1210: Using directives should be ordered alphabetically by the namespaces
dotnet_diagnostic.SA1210.severity = none
# SA1211: Using alias directive ordering
dotnet_diagnostic.SA1211.severity = none
# SA1212: A get accessor appears after a set accessor within a property or indexer
dotnet_diagnostic.SA1212.severity = warning
# SA1214: Readonly fields should appear before non-readonly fields
dotnet_diagnostic.SA1214.severity = none
# SA1216: Using static directives should be placed at the correct location
dotnet_diagnostic.SA1216.severity = none
# SA1300: Element should begin with an uppercase letter
dotnet_diagnostic.SA1300.severity = none
# SA1302: Interface names should begin with I
dotnet_diagnostic.SA1302.severity = warning
# SA1303: Const field names should begin with upper-case letter
dotnet_diagnostic.SA1303.severity = none
# SA1304: Non-private readonly fields should begin with upper-case letter
dotnet_diagnostic.SA1304.severity = none
# SA1306: Field should begin with lower-case letter
dotnet_diagnostic.SA1306.severity = none
# SA1307: Field should begin with upper-case letter
dotnet_diagnostic.SA1307.severity = none
# SA1308: Field should not begin with the prefix 's_'
dotnet_diagnostic.SA1308.severity = none
# SA1309: Field names should not begin with underscore
dotnet_diagnostic.SA1309.severity = none
# SA1310: Field should not contain an underscore
dotnet_diagnostic.SA1310.severity = none
# SA1311: Static readonly fields should begin with upper-case letter
dotnet_diagnostic.SA1311.severity = none
# SA1312: Variable should begin with lower-case letter
dotnet_diagnostic.SA1312.severity = none
# SA1313: Parameter should begin with lower-case letter
dotnet_diagnostic.SA1313.severity = none
# SA1314: Type parameter names should begin with T
dotnet_diagnostic.SA1314.severity = none
# SA1316: Tuple element names should use correct casing
dotnet_diagnostic.SA1316.severity = none
# SA1400: Member should declare an access modifer
dotnet_diagnostic.SA1400.severity = warning
# SA1401: Fields should be private
dotnet_diagnostic.SA1401.severity = none
# SA1402: File may only contain a single type
dotnet_diagnostic.SA1402.severity = none
# SA1403: File may only contain a single namespace
dotnet_diagnostic.SA1403.severity = none
# SA1404: Code analysis suppression should have justification
dotnet_diagnostic.SA1404.severity = warning
# SA1405: Debug.Assert should provide message text
dotnet_diagnostic.SA1405.severity = none
# SA1407: Arithmetic expressions should declare precedence
dotnet_diagnostic.SA1407.severity = none
# SA1408: Conditional expressions should declare precedence
dotnet_diagnostic.SA1408.severity = none
# SA1410: Remove delegate parens when possible
dotnet_diagnostic.SA1410.severity = warning
# SA1411: Attribute constructor shouldn't use unnecessary parenthesis
dotnet_diagnostic.SA1411.severity = warning
# SA1413: Use trailing comma in multi-line initializers
dotnet_diagnostic.SA1413.severity = none
# SA1414: Tuple types in signatures should have element names
dotnet_diagnostic.SA1414.severity = none
# SA1500: Braces for multi-line statements should not share line
dotnet_diagnostic.SA1500.severity = none
# SA1501: Statement should not be on a single line
dotnet_diagnostic.SA1501.severity = none
# SA1502: Element should not be on a single line
dotnet_diagnostic.SA1502.severity = none
# SA1503: Braces should not be omitted
dotnet_diagnostic.SA1503.severity = none
# SA1504: All accessors should be single-line or multi-line
dotnet_diagnostic.SA1504.severity = none
# SA1505: An opening brace should not be followed by a blank line
dotnet_diagnostic.SA1505.severity = none
# SA1506: Element documentation headers should not be followed by blank line
dotnet_diagnostic.SA1506.severity = none
# SA1507: Code should not contain multiple blank lines in a row
dotnet_diagnostic.SA1507.severity = none
# SA1508: A closing brace should not be preceded by a blank line
dotnet_diagnostic.SA1508.severity = none
# SA1509: Opening braces should not be preceded by blank line
dotnet_diagnostic.SA1509.severity = none
# SA1510: 'else' statement should not be preceded by a blank line
dotnet_diagnostic.SA1510.severity = none
# SA1512: Single-line comments should not be followed by blank line
dotnet_diagnostic.SA1512.severity = none
# SA1513: Closing brace should be followed by blank line
dotnet_diagnostic.SA1513.severity = none
# SA1514: Element documentation header should be preceded by blank line
dotnet_diagnostic.SA1514.severity = none
# SA1515: Single-line comment should be preceded by blank line
dotnet_diagnostic.SA1515.severity = none
# SA1516: Elements should be separated by blank line
dotnet_diagnostic.SA1516.severity = none
# SA1517: Code should not contain blank lines at start of file
dotnet_diagnostic.SA1517.severity = warning
# SA1518: Code should not contain blank lines at the end of the file
dotnet_diagnostic.SA1518.severity = warning
# SA1519: Braces should not be omitted from multi-line child statement
dotnet_diagnostic.SA1519.severity = none
# SA1520: Use braces consistently
dotnet_diagnostic.SA1520.severity = none
# SA1600: Elements should be documented
dotnet_diagnostic.SA1600.severity = none
# SA1601: Partial elements should be documented
dotnet_diagnostic.SA1601.severity = none
# SA1602: Enumeration items should be documented
dotnet_diagnostic.SA1602.severity = none
# SA1604: Element documentation should have summary
dotnet_diagnostic.SA1604.severity = none
# SA1605: Partial element documentation should have summary
dotnet_diagnostic.SA1605.severity = none
# SA1606: Element documentation should have summary text
dotnet_diagnostic.SA1606.severity = none
# SA1608: Element documentation should not have default summary
dotnet_diagnostic.SA1608.severity = none
# SA1610: Property documentation should have value text
dotnet_diagnostic.SA1610.severity = none
# SA1611: The documentation for parameter 'message' is missing
dotnet_diagnostic.SA1611.severity = none
# SA1612: The parameter documentation is at incorrect position
dotnet_diagnostic.SA1612.severity = none
# SA1614: Element parameter documentation should have text
dotnet_diagnostic.SA1614.severity = none
# SA1615: Element return value should be documented
dotnet_diagnostic.SA1615.severity = none
# SA1616: Element return value documentation should have text
dotnet_diagnostic.SA1616.severity = none
# SA1618: The documentation for type parameter is missing
dotnet_diagnostic.SA1618.severity = none
# SA1619: The documentation for type parameter is missing
dotnet_diagnostic.SA1619.severity = none
# SA1622: Generic type parameter documentation should have text
dotnet_diagnostic.SA1622.severity = none
# SA1623: Property documentation text
dotnet_diagnostic.SA1623.severity = none
# SA1624: Because the property only contains a visible get accessor, the documentation summary text should begin with 'Gets'
dotnet_diagnostic.SA1624.severity = none
# SA1625: Element documentation should not be copied and pasted
dotnet_diagnostic.SA1625.severity = none
# SA1626: Single-line comments should not use documentation style slashes
dotnet_diagnostic.SA1626.severity = none
# SA1627: The documentation text within the \'exception\' tag should not be empty
dotnet_diagnostic.SA1627.severity = none
# SA1629: Documentation text should end with a period
dotnet_diagnostic.SA1629.severity = none
# SA1633: File should have header
dotnet_diagnostic.SA1633.severity = none
# SA1642: Constructor summary documentation should begin with standard text
dotnet_diagnostic.SA1642.severity = none
# SA1643: Destructor summary documentation should begin with standard text
dotnet_diagnostic.SA1643.severity = none
# SA1649: File name should match first type name
dotnet_diagnostic.SA1649.severity = none
# IDE0001: Simplify name
dotnet_diagnostic.IDE0001.severity = suggestion
# IDE0002: Simplify member access
dotnet_diagnostic.IDE0002.severity = suggestion
# IDE0003: Remove this or Me qualification
dotnet_diagnostic.IDE0003.severity = suggestion
# IDE0004: Remove Unnecessary Cast
dotnet_diagnostic.IDE0004.severity = suggestion
# IDE0005: Using directive is unnecessary.
dotnet_diagnostic.IDE0005.severity = warning
# IDE0007: Use implicit type
dotnet_diagnostic.IDE0007.severity = silent
# IDE0008: Use explicit type
dotnet_diagnostic.IDE0008.severity = suggestion
# IDE0009: Add this or Me qualification
dotnet_diagnostic.IDE0009.severity = silent
# IDE0010: Add missing cases
dotnet_diagnostic.IDE0010.severity = silent
# IDE0011: Add braces
dotnet_diagnostic.IDE0011.severity = silent
# IDE0016: Use 'throw' expression
dotnet_diagnostic.IDE0016.severity = silent
# IDE0017: Simplify object initialization
dotnet_diagnostic.IDE0017.severity = suggestion
# IDE0018: Inline variable declaration
dotnet_diagnostic.IDE0018.severity = suggestion
# IDE0019: Use pattern matching to avoid as followed by a null check
dotnet_diagnostic.IDE0019.severity = suggestion
# IDE0020: Use pattern matching to avoid is check followed by a cast (with variable)
dotnet_diagnostic.IDE0020.severity = warning
# IDE0021: Use expression body for constructors
dotnet_diagnostic.IDE0021.severity = silent
# IDE0022: Use expression body for methods
dotnet_diagnostic.IDE0022.severity = silent
# IDE0023: Use expression body for operators
dotnet_diagnostic.IDE0023.severity = silent
# IDE0024: Use expression body for operators
dotnet_diagnostic.IDE0024.severity = silent
# IDE0025: Use expression body for properties
dotnet_diagnostic.IDE0025.severity = silent
# IDE0026: Use expression body for indexers
dotnet_diagnostic.IDE0026.severity = silent
# IDE0027: Use expression body for accessors
dotnet_diagnostic.IDE0027.severity = silent
# IDE0028: Simplify collection initialization
dotnet_diagnostic.IDE0028.severity = suggestion
# IDE0029: Use coalesce expression
dotnet_diagnostic.IDE0029.severity = warning
# IDE0030: Use coalesce expression
dotnet_diagnostic.IDE0030.severity = warning
# IDE0031: Use null propagation
dotnet_diagnostic.IDE0031.severity = warning
# IDE0032: Use auto property
dotnet_diagnostic.IDE0032.severity = silent
# IDE0033: Use explicitly provided tuple name
dotnet_diagnostic.IDE0033.severity = suggestion
# IDE0034: Simplify 'default' expression
dotnet_diagnostic.IDE0034.severity = suggestion
# IDE0035: Remove unreachable code
dotnet_diagnostic.IDE0035.severity = suggestion
# IDE0036: Order modifiers
dotnet_diagnostic.IDE0036.severity = warning
# IDE0037: Use inferred member name
dotnet_diagnostic.IDE0037.severity = silent
# IDE0038: Use pattern matching to avoid is check followed by a cast (without variable)
dotnet_diagnostic.IDE0038.severity = suggestion
# IDE0039: Use local function
dotnet_diagnostic.IDE0039.severity = suggestion
# IDE0040: Add accessibility modifiers
dotnet_diagnostic.IDE0040.severity = suggestion
# IDE0041: Use 'is null' check
dotnet_diagnostic.IDE0041.severity = warning
# IDE0042: Deconstruct variable declaration
dotnet_diagnostic.IDE0042.severity = silent
# IDE0043: Invalid format string
dotnet_diagnostic.IDE0043.severity = warning
# IDE0044: Add readonly modifier
dotnet_diagnostic.IDE0044.severity = suggestion
# IDE0045: Use conditional expression for assignment
dotnet_diagnostic.IDE0045.severity = suggestion
# IDE0046: Use conditional expression for return
dotnet_diagnostic.IDE0046.severity = suggestion
# IDE0047: Remove unnecessary parentheses
dotnet_diagnostic.IDE0047.severity = silent
# IDE0048: Add parentheses for clarity
dotnet_diagnostic.IDE0048.severity = silent
# IDE0049: Use language keywords instead of framework type names for type references
dotnet_diagnostic.IDE0049.severity = warning
# IDE0050: Convert anonymous type to tuple
dotnet_diagnostic.IDE0050.severity = suggestion
# IDE0051: Remove unused private members
dotnet_diagnostic.IDE0051.severity = suggestion
# IDE0052: Remove unread private members
dotnet_diagnostic.IDE0052.severity = suggestion
# IDE0053: Use expression body for lambdas
dotnet_diagnostic.IDE0053.severity = silent
# IDE0054: Use compound assignment
dotnet_diagnostic.IDE0054.severity = warning
# IDE0055: Fix formatting
dotnet_diagnostic.IDE0055.severity = suggestion
# IDE0056: Use index operator
dotnet_diagnostic.IDE0056.severity = suggestion
# IDE0057: Use range operator
dotnet_diagnostic.IDE0057.severity = suggestion
# IDE0058: Expression value is never used
dotnet_diagnostic.IDE0058.severity = silent
# IDE0059: Unnecessary assignment of a value
dotnet_diagnostic.IDE0059.severity = warning
# IDE0060: Remove unused parameter
dotnet_diagnostic.IDE0060.severity = silent
dotnet_code_quality_unused_parameters = non_public
# IDE0061: Use expression body for local functions
dotnet_diagnostic.IDE0061.severity = silent
# IDE0062: Make local function 'static'
dotnet_diagnostic.IDE0062.severity = warning
# IDE0063: Use simple 'using' statement
dotnet_diagnostic.IDE0063.severity = silent
# IDE0064: Make readonly fields writable
dotnet_diagnostic.IDE0064.severity = silent
# IDE0065: Misplaced using directive
dotnet_diagnostic.IDE0065.severity = warning
# IDE0066: Convert switch statement to expression
dotnet_diagnostic.IDE0066.severity = suggestion
# IDE0070: Use 'System.HashCode'
dotnet_diagnostic.IDE0070.severity = suggestion
# IDE0071: Simplify interpolation
dotnet_diagnostic.IDE0071.severity = warning
# IDE0072: Add missing cases
dotnet_diagnostic.IDE0072.severity = silent
# IDE0073: The file header is missing or not located at the top of the file
dotnet_diagnostic.IDE0073.severity = warning
# IDE0074: Use compound assignment
dotnet_diagnostic.IDE0074.severity = warning
# IDE0075: Simplify conditional expression
dotnet_diagnostic.IDE0075.severity = silent
# IDE0076: Invalid global 'SuppressMessageAttribute'
dotnet_diagnostic.IDE0076.severity = warning
# IDE0077: Avoid legacy format target in 'SuppressMessageAttribute'
dotnet_diagnostic.IDE0077.severity = silent
# IDE0078: Use pattern matching
dotnet_diagnostic.IDE0078.severity = suggestion
# IDE0079: Remove unnecessary suppression
dotnet_diagnostic.IDE0079.severity = suggestion
# IDE0080: Remove unnecessary suppression operator
dotnet_diagnostic.IDE0080.severity = warning
# IDE0081: Remove unnecessary suppression operator
dotnet_diagnostic.IDE0081.severity = none
# IDE0082: 'typeof' can be converted to 'nameof'
dotnet_diagnostic.IDE0082.severity = warning
# IDE0083: Use pattern matching
dotnet_diagnostic.IDE0083.severity = silent
# IDE0084: Use pattern matching (IsNot operator)
dotnet_diagnostic.IDE0084.severity = none
# IDE0090: Use 'new(...)'
dotnet_diagnostic.IDE0090.severity = silent
# IDE0100: Remove redundant equality
dotnet_diagnostic.IDE0100.severity = warning
# IDE0110: Remove unnecessary discard
dotnet_diagnostic.IDE0110.severity = warning
# IDE0120: Simplify LINQ expression
dotnet_diagnostic.IDE0120.severity = none
# IDE0130: Namespace does not match folder structure
dotnet_diagnostic.IDE0130.severity = silent
# IDE0140: Simplify object creation
dotnet_diagnostic.IDE0140.severity = none
# IDE0150: Prefer 'null' check over type check
dotnet_diagnostic.IDE0150.severity = silent
# IDE0160: Convert to block scoped namespace
dotnet_diagnostic.IDE0160.severity = silent
# IDE0161: Convert to file-scoped namespace
dotnet_diagnostic.IDE0161.severity = silent
# IDE1005: Delegate invocation can be simplified.
dotnet_diagnostic.IDE1005.severity = warning
# IDE1006: Naming styles
dotnet_diagnostic.IDE1006.severity = silent
# IDE2000: Allow multiple blank lines
dotnet_diagnostic.IDE2000.severity = silent
# IDE2001: Embedded statements must be on their own line
dotnet_diagnostic.IDE2001.severity = silent
# IDE2002: Consecutive braces must not have blank line between them
dotnet_diagnostic.IDE2002.severity = silent
# IDE2003: Allow statement immediately after block
dotnet_diagnostic.IDE2003.severity = silent
# IDE2004: Blank line not allowed after constructor initializer colon
dotnet_diagnostic.IDE2004.severity = silent
================================================
FILE: .gitattributes
================================================
###############################################################################
# Set default behavior to automatically normalize line endings.
###############################################################################
* text=auto
*.sh text eol=lf
*.ps1 text eol=crlf
###############################################################################
# Set default behavior for command prompt diff.
#
# This is need for earlier builds of msysgit that does not have it on by
# default for csharp files.
# Note: This is only used by command line
###############################################################################
#*.cs diff=csharp
###############################################################################
# Set the merge driver for project and solution files
#
# Merging from the command prompt will add diff markers to the files if there
# are conflicts (Merging from VS is not affected by the settings below, in VS
# the diff markers are never inserted). Diff markers may cause the following
# file extensions to fail to load in VS. An alternative would be to treat
# these files as binary and thus will always conflict and require user
# intervention with every merge. To do so, just uncomment the entries below
###############################################################################
#*.sln merge=binary
#*.csproj merge=binary
#*.vbproj merge=binary
#*.vcxproj merge=binary
#*.vcproj merge=binary
#*.dbproj merge=binary
#*.fsproj merge=binary
#*.lsproj merge=binary
#*.wixproj merge=binary
#*.modelproj merge=binary
#*.sqlproj merge=binary
#*.wwaproj merge=binary
###############################################################################
# behavior for image files
#
# image files are treated as binary by default.
###############################################################################
#*.jpg binary
#*.png binary
#*.gif binary
###############################################################################
# diff behavior for common document formats
#
# Convert binary document formats to text before diffing them. This feature
# is only available from the command line. Turn it on by uncommenting the
# entries below.
###############################################################################
#*.doc diff=astextplain
#*.DOC diff=astextplain
#*.docx diff=astextplain
#*.DOCX diff=astextplain
#*.dot diff=astextplain
#*.DOT diff=astextplain
#*.pdf diff=astextplain
#*.PDF diff=astextplain
#*.rtf diff=astextplain
#*.RTF diff=astextplain
================================================
FILE: .github/workflows/copilot-setup-steps.yml
================================================
name: "Copilot Setup Steps"
# Automatically run the setup steps when they are changed to allow for easy validation, and
# allow manual testing through the repository's "Actions" tab
on:
workflow_dispatch:
push:
paths:
- .github/workflows/copilot-setup-steps.yml
pull_request:
paths:
- .github/workflows/copilot-setup-steps.yml
jobs:
# The job MUST be called `copilot-setup-steps` or it will not be picked up by Copilot.
copilot-setup-steps:
runs-on: ubuntu-latest
# Set the permissions to the lowest permissions possible needed for your steps.
# Copilot will be given its own token for its operations.
permissions:
# If you want to clone the repository as part of your setup steps, for example to install dependencies, you'll need the `contents: read` permission. If you don't clone the repository in your setup steps, Copilot will do this for you automatically after the steps complete.
contents: read
# You can define any steps you want, and they will run before the agent starts.
# If you do not check out your code, Copilot will do this for you.
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup .NET SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
8.0.x
9.0.x
10.0.x
11.0.x
================================================
FILE: .github/workflows/default.yml
================================================
name: default
on:
push:
branches:
- "main"
- "master"
- "dev"
pull_request:
# The branches below must be a subset of the branches above
branches:
- "main"
- "master"
- "dev"
jobs:
build:
name: Running tests on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
# max-parallel: 1
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
steps:
- uses: actions/checkout@v6
- name: Setup .NET SDK
uses: actions/setup-dotnet@v5
with:
dotnet-version: |
8.0.x
9.0.x
10.0.x
11.0.x
- name: dotnet info
run: dotnet --info
- name: build
run: dotnet build.cs
================================================
FILE: .github/workflows/docfx.yml
================================================
name: docs
on:
push:
branches:
- main
- master
jobs:
build:
name: Build
runs-on: windows-latest
steps:
# Check out the branch that triggered this workflow to the 'source' subdirectory
- name: Checkout Code
uses: actions/checkout@v6
- name: Setup .NET SDK
uses: actions/setup-dotnet@v5
with:
dotnet-version: 11.0.x
- name: install DocFX
run: "dotnet tool install -g docfx"
- name: Build docs
run: "docfx ./docs/docfx.json"
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/_site
================================================
FILE: .github/workflows/dotnet-format.yml
================================================
name: dotnet-format
on:
push:
branches:
- "dev"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Setup .NET SDK
uses: actions/setup-dotnet@v5
with:
dotnet-version: 11.0.x
- name: build
run: dotnet build
- name: format
run: dotnet format -v=diag
- name: check for changes
run: |
if git diff --exit-code; then
echo "has_changes=false" >> $GITHUB_ENV
else
echo "has_changes=true" >> $GITHUB_ENV
fi
- name: Commit and Push
if: ${{ env.has_changes == 'true' }}
shell: bash
run: |
# echo $GITHUB_REF_NAME
# echo $GITHUB_SHA
git config --local user.name "github-actions[bot]"
git config --local user.email "weihanli@outlook.com"
git add -u
git commit -m "Automated dotnet-format update from commit ${GITHUB_SHA} on ${GITHUB_REF}"
git log -1
remote_repo="https://${GITHUB_ACTOR}:${{secrets.GITHUB_TOKEN}}@github.com/${GITHUB_REPOSITORY}.git"
git push "${remote_repo}" HEAD:${GITHUB_REF}
================================================
FILE: .github/workflows/release.yml
================================================
name: Release
on:
workflow_dispatch:
push:
branches: [ master ]
jobs:
build:
name: Release
runs-on: windows-latest
steps:
- uses: actions/checkout@v6
- name: Setup .NET SDK
uses: actions/setup-dotnet@v5
with:
dotnet-version: |
8.0.x
9.0.x
10.0.x
11.0.x
- name: Build
shell: pwsh
run: dotnet build.cs --stable=true
- name: Get Release Version
shell: pwsh
run: dotnet ./build/exportReleaseVersion.cs
- name: create release
shell: pwsh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create ${{ env.ReleaseVersion }} --generate-notes --target master
================================================
FILE: .gitignore
================================================
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
# Cutom files
localBuild/
# User-specific files
*.suo
*.user
*.userosscache
*.sln.docstates
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
.mono/
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
[Oo]ut/
# Visual Studio cache/options directory
.vs/
# Visual Studio code options directory
.vscode/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUNIT
*.VisualState.xml
TestResult.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
# .NET Core
project.lock.json
project.fragment.lock.json
artifacts/
**/Properties/launchSettings.json
*_i.c
*_p.c
*_i.h
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb
# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# JustCode is a .NET coding add-in
.JustCode
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# Visual Studio code coverage results
*.coverage
*.coveragexml
# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# TODO: Comment the next line if you want to checkin your web deploy settings
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/
# NuGet Packages
*.nupkg
# The packages folder can be ignored because of Package Restore
**/packages/*
# except build/, which is used as an MSBuild target.
!**/packages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/packages/repositories.config
# NuGet v3's project.json files produces more ignorable files
*.nuget.props
*.nuget.targets
# Microsoft Azure Build Output
csx/
*.build.csdef
# Microsoft Azure Emulator
ecf/
rcf/
# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!*.[Cc]ache/
# Others
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.jfm
*.pfx
*.publishsettings
orleans.codegen.cs
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
# SQL Server files
*.mdf
*.ldf
*.ndf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
# Microsoft Fakes
FakesAssemblies/
# GhostDoc plugin setting file
*.GhostDoc.xml
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
node_modules/
# Typescript v1 declaration files
typings/
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
*.vbw
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions
# Paket dependency manager
.paket/paket.exe
paket-files/
# FAKE - F# Make
.fake/
# JetBrains Rider
.idea/
*.sln.iml
# CodeRush
.cr/
# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
# Cake - Uncomment if you are using it
tools/**
build/tools/**
# Telerik's JustMock configuration file
*.jmconfig
# BizTalk build output
*.btp.cs
*.btm.cs
*.odx.cs
*.xsd.cs
================================================
FILE: .husky/commit-msg
================================================
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
# dotnet tool update -g dotnet-execute --prerelease
# dotnet husky run --name "commit-message-linter" --args "$1"
echo
echo Great work! 🥂
echo
================================================
FILE: .husky/post-push
================================================
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
## husky task runner examples -------------------
## Note : for local installation use 'dotnet' prefix. e.g. 'dotnet husky'
## run all tasks
#husky run
### run all tasks with group: 'group-name'
#husky run --group group-name
## run task with name: 'task-name'
#husky run --name task-name
## pass hook arguments to task
#husky run --args "$1" "$2"
## or put your custom commands -------------------
#echo 'Husky.Net is awesome!'
# dotnet husky run --group post-push
================================================
FILE: .husky/pre-commit
================================================
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
# task-runner config https://alirezanet.github.io/Husky.Net/guide/task-runner.html
# run tasks by task name
# dotnet husky run --name "build"
# dotnet husky run --name "format-verify"
# run tasks by task group name
# dotnet husky run --group pre-commit
================================================
FILE: .husky/pre-push
================================================
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
# dotnet husky run --group pre-push
================================================
FILE: .husky/scripts/commit-lint.cs
================================================
/*
A simple regex commit linter
https://www.conventionalcommits.org/en/v1.0.0/
https://github.com/angular/angular/blob/22b96b9/CONTRIBUTING.md#type
*/
const string pattern = @"^(?=.{1,90}$)(?:build|feat|ci|chore|docs|fix|perf|refactor|revert|style|sample|test)(?:\(.+\))*(?::).{4,}(?:#\d+)*(?<![\.\s])$";
var msg = File.ReadAllLines(args[0])[0];
Console.WriteLine("Your commit headline message is:\n> {0}", msg);
if (System.Text.RegularExpressions.Regex.IsMatch(msg, pattern))
return 0;
if (msg.StartsWith("Merge branch "))
return 0;
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine("Invalid commit message");
Console.ResetColor();
Console.WriteLine("e.g: 'feat(scope): subject' or 'fix: subject'");
Console.ForegroundColor = ConsoleColor.Gray;
Console.WriteLine("more info: https://www.conventionalcommits.org/en/v1.0.0/");
Console.ResetColor();
return 1;
================================================
FILE: .husky/task-runner.json
================================================
{
"tasks":
[
{
"name": "commit-message-linter",
"group": "commit-msg",
"command": "dotnet-exec",
"args": [".husky/scripts/commit-lint.cs", "--args", "${args}"]
},
{
"name": "test",
"group": "pre-push",
"command": "dotnet",
"args": [ "test" ],
"exclude": [
"**/*.md",
"docs/**/*"
]
},
{
"name": "dotnet-format",
"group": "post-push",
"command": "dotnet",
"args": [ "format" ],
"include": [
"**/*.cs"
]
}
]
}
================================================
FILE: AGENTS.md
================================================
# AGENTS.md — WeihanLi.Common
This file gives AI coding agents the context needed to work on this repository effectively.
## Project Overview
**WeihanLi.Common** is a production-ready .NET utility library that bundles helpers, extensions, and middleware for .NET application development. It covers dependency injection, AOP (Fluent Aspects), eventing, logging, data access helpers, OTP utilities, templating, and more.
Three NuGet packages are published from this repository:
| Package | Description |
|---|---|
| `WeihanLi.Common` | Core helpers, extensions, DI, AOP, event bus, TOTP, templating, and more |
| `WeihanLi.Common.Logging.Serilog` | Integration layer forwarding to Serilog or Microsoft.Extensions.Logging |
| `WeihanLi.Extensions.Hosting` | Helpers for background services, console apps, and DI bootstrapping |
## Repository Structure
```
├── src/
│ ├── WeihanLi.Common/ # Core library
│ ├── WeihanLi.Common.Logging.Serilog/ # Serilog integration
│ └── WeihanLi.Extensions.Hosting/ # Hosting extensions
├── test/
│ └── WeihanLi.Common.Test/ # xUnit tests
├── samples/
│ ├── AspNetCoreSample/ # ASP.NET Core usage examples
│ └── DotNetCoreSample/ # Console app examples
├── perf/
│ └── WeihanLi.Common.Benchmark/ # BenchmarkDotNet benchmarks
├── docs/ # DocFX documentation
├── build/ # Build configuration (signing, versioning)
├── .github/workflows/ # GitHub Actions CI/CD
├── build.cs # C# build script (run with dotnet build.cs)
├── WeihanLi.Common.slnx # Solution file (modern .slnx format)
├── Directory.Build.props # Centralized MSBuild configuration
├── Directory.Packages.props # Centralized NuGet package versions
└── global.json # .NET SDK version pin
```
## Build and Test
### Prerequisites
- .NET SDK 10.0+ (see `global.json`; `rollForward` is enabled for newer versions)
- Supported SDK versions for CI: 8.0.x, 9.0.x, 10.0.x
### Commands
```bash
# Build the entire solution
dotnet build
# Run all tests
dotnet test
# Full CI build (build + test + pack)
dotnet build.cs
# Format code
dotnet format
```
> Set `DISABLE_GITHUB_ACTIONS_TEST_LOGGER=true` to opt out of the GitHub Actions test logger when running tests locally.
### CI
- **GitHub Actions** (`.github/workflows/default.yml`): runs `dotnet build.cs` on Ubuntu, macOS, and Windows
- **Azure Pipelines** (`azure-pipelines.yml`): additional pipeline for Azure DevOps
## Target Frameworks
- `WeihanLi.Common`: `netstandard2.0`, `net8.0`, `net9.0`, `net10.0`
- `WeihanLi.Common.Logging.Serilog`: `netstandard2.0`, `net8.0`
- `WeihanLi.Extensions.Hosting`: `net8.0`
Use conditional compilation (`#if NET8_0_OR_GREATER` etc.) for framework-specific code.
## Key Namespaces and Components
| Namespace | Purpose |
|---|---|
| `WeihanLi.Common` | Core utilities, `Guard`, `CacheUtil`, `DependencyResolver` |
| `WeihanLi.Common.Aspect` | Fluent Aspects AOP — dynamic proxies, interceptors, invocation |
| `WeihanLi.Common.Data` | ADO.NET extensions, entity mapping, SQL expression parsers |
| `WeihanLi.Common.DependencyInjection` | Lightweight DI container, service definitions, module support |
| `WeihanLi.Common.Event` | `EventBus`, `EventQueue`, `EventStore`, publish/subscribe |
| `WeihanLi.Common.Extensions` | Extension methods for core .NET types |
| `WeihanLi.Common.Helpers` | `ApplicationHelper`, `TotpHelper`, `CommandExecutor`, `ConsoleHelper`, etc. |
| `WeihanLi.Common.Http` | HTTP client utilities, mock handlers |
| `WeihanLi.Common.Logging` | Logging abstractions and adapters |
| `WeihanLi.Common.Otp` | TOTP/OTP implementation |
| `WeihanLi.Common.Services` | Common service implementations |
| `WeihanLi.Common.Template` | Lightweight template engine |
| `WeihanLi.Extensions` | Shared extension methods (string, collections, etc.) |
## Code Style and Conventions
- **Language**: C# with nullable reference types enabled (`<Nullable>enable</Nullable>`) and implicit usings
- **Naming**: PascalCase for public members; _camelCase for private fields (private static readonly fields may use PascalCase)
- **License header**: Apache License 2.0 header in every source file
- **Formatting**: governed by `.editorconfig` — run `dotnet format` before committing
### Parameter Validation
Always validate parameters using the `Guard` class:
```csharp
public static string Process(string input)
{
Guard.NotNullOrEmpty(input);
// implementation
}
```
### Extension Methods
Place extension methods in dedicated files with descriptive names, using the `WeihanLi.Extensions` namespace:
```csharp
namespace WeihanLi.Extensions;
public static class StringExtension
{
public static bool IsNullOrEmpty(this string? str) => string.IsNullOrEmpty(str);
}
```
### Fluent API Design
Many components expose fluent interfaces:
```csharp
FluentAspects.Configure(options =>
options.InterceptAll()
.With<LoggingInterceptor>()
);
```
### Options Pattern
Use the options pattern for configurable components:
```csharp
public sealed class ServiceOptions
{
public string ConnectionString { get; set; } = string.Empty;
public int Timeout { get; set; } = 30;
}
```
## Testing Guidelines
- **Framework**: xUnit v3 on Microsoft Testing Platform (`xunit.v3.mtp-v2`)
- **Runner**: Microsoft Testing Platform (`UseMicrosoftTestingPlatformRunner=true`)
- **Location**: `test/WeihanLi.Common.Test/`
- **File naming**: `{ComponentName}Test.cs`
- **Namespace**: `WeihanLi.Common.Test`
- Test method names follow the pattern `MethodName_Scenario_ExpectedResult`
```csharp
[Fact]
public void MethodName_Scenario_ExpectedResult()
{
// Arrange
var input = "test";
// Act
var result = SystemUnderTest.Process(input);
// Assert
Assert.NotNull(result);
}
```
Use `[Theory]` + `[InlineData]` for parameterized tests.
## Common Development Tasks
### Adding a New Extension Method
1. Create (or edit) the appropriate file in `src/WeihanLi.Common/Extensions/`
2. Use namespace `WeihanLi.Extensions`
3. Add XML documentation for all public members
4. Write a corresponding test in `test/WeihanLi.Common.Test/`
### Adding a New Helper or Service
1. Define an interface in `Abstractions/` if applicable
2. Implement in `Helpers/` or `Services/`
3. Add configuration options class if configurable
4. Register with DI if applicable
5. Write tests and update samples if the feature is significant
### Working with AOP (Fluent Aspects)
```csharp
// Configure interceptors
FluentAspects.Configure(options =>
{
options.InterceptMethod<IService>(s => s.Process(Argument.Any<string>()))
.With<ValidationInterceptor>();
});
// Create proxy
var service = FluentAspects.AspectOptions.ProxyFactory
.CreateProxy<IService>(new ServiceImplementation());
```
### Database / Data-Access Extensions
```csharp
// Query using ADO.NET extensions
var users = connection.Select<User>(
"SELECT * FROM Users WHERE Age > @age", new { age = 18 });
// Repository pattern
var repository = new Repository<User>(() => connectionFactory.GetConnection());
var user = repository.Fetch(u => u.Id == userId);
```
## Dependencies
Key NuGet dependencies and their roles:
| Package | Role |
|---|---|
| `Microsoft.Extensions.*` | Configuration, Logging, Hosting, DI abstractions |
| `Newtonsoft.Json` | JSON serialization |
| `Serilog` | Structured logging (via Serilog integration package) |
| `Dapper` | Lightweight ORM / ADO.NET helper |
| `PolySharp` | Polyfill attributes for older .NET targets |
| `xunit.v3` | Test framework |
| `BenchmarkDotNet` | Performance benchmarks |
Package versions are centrally managed in `Directory.Packages.props` — update versions there rather than in individual project files.
## Security
- Validate all inputs using `Guard` utilities
- Dispose resources properly (use `using` statements)
- Use `RandomNumberGenerator` (not `Random`) for cryptographic operations
- Never commit secrets or credentials
- NuGet audit is enabled via MSBuild properties (see `Directory.Build.props` / `Directory.Packages.props` with `<NuGetAudit>true</NuGetAudit>`); do not suppress audit warnings without justification
## Pull Request Guidelines
### Commit Message Conventions
This project follows the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification. Every commit message must be structured as:
```
<type>[optional scope]: <description>
[optional body]
[optional footer(s)]
```
**Common types:**
| Type | When to use |
|---|---|
| `feat` | A new feature (correlates with MINOR in SemVer) |
| `fix` | A bug fix (correlates with PATCH in SemVer) |
| `docs` | Documentation-only changes |
| `style` | Formatting, missing semicolons, etc. — no logic change |
| `refactor` | Code change that is neither a fix nor a feature |
| `perf` | Performance improvement |
| `test` | Adding or correcting tests |
| `build` | Changes to the build system or external dependencies |
| `ci` | Changes to CI/CD configuration files |
| `chore` | Maintenance tasks that don't modify src or test files |
**Breaking changes**: append `!` after the type/scope or add a `BREAKING CHANGE:` footer.
**Examples:**
```
feat(event): add retry support to EventBus
fix(otp): correct TOTP window boundary calculation
docs: update AGENTS.md with PR guidelines
build: bump Newtonsoft.Json to 13.0.4
feat!: remove obsolete IDependencyResolver overloads
BREAKING CHANGE: IDependencyResolver.GetService<T>() overloads that
accepted a string key have been removed. Use keyed services instead.
```
### Required Checks Before Submitting
- `dotnet build` — must compile without errors or warnings
- `dotnet test` — all tests must pass
- `dotnet format --verify-no-changes` — no formatting violations
### PR Title Format
Use the same `<type>[optional scope]: <description>` format as the commit message.
## Debugging and Troubleshooting
- **Build failures**: run `dotnet build --verbosity detailed` for full MSBuild output
- **Test failures on a specific framework**: use `dotnet test -f net8.0` to target one TFM
- **GitHub Actions test logger noise locally**: set `DISABLE_GITHUB_ACTIONS_TEST_LOGGER=true`
- **NuGet restore errors**: verify `Directory.Packages.props` contains the version; do not add `<Version>` in individual `.csproj` files
- **Reflection.Emit issues on netstandard2.0**: the package conditionally references `System.Reflection.Emit` — guard with `#if !NETSTANDARD2_0` or `#if NET8_0_OR_GREATER` as appropriate
## Documentation
- XML documentation is required on all public APIs
- Docs live in `docs/` and are generated with DocFX (`docs/docfx.json`)
- Release notes are in `docs/ReleaseNotes.md`
- Samples in `samples/` demonstrate end-to-end usage patterns
================================================
FILE: Directory.Build.props
================================================
<Project>
<Import Project="./build/version.props" />
<PropertyGroup>
<LatestTargetFramework>net10.0</LatestTargetFramework>
<LangVersion>preview</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Authors>WeihanLi</Authors>
<Copyright>Copyright 2017-$([System.DateTime]::Now.Year) (c) WeihanLi</Copyright>
<NoWarn>$(NoWarn);NU5048;CS1591;NETSDK1057</NoWarn>
<ArtifactsPath>$(MSBuildThisFileDirectory)artifacts</ArtifactsPath>
<ContinuousIntegrationBuild Condition="'$(CI)' == 'true' or '$(TF_BUILD)' == 'true' or '$(GITHUB_ACTIONS)' == 'true'">true</ContinuousIntegrationBuild>
<!-- NuGet Audit https://learn.microsoft.com/en-us/nuget/concepts/auditing-packages -->
<NuGetAudit>true</NuGetAudit>
<NuGetAuditMode>direct</NuGetAuditMode>
</PropertyGroup>
</Project>
================================================
FILE: Directory.Build.targets
================================================
<Project>
</Project>
================================================
FILE: Directory.Packages.props
================================================
<Project>
<PropertyGroup>
<!-- Enable central package management -->
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<!-- Enable Transitive Package Pinning -->
<CentralPackageTransitivePinningEnabled>true</CentralPackageTransitivePinningEnabled>
<!-- https://learn.microsoft.com/en-us/nuget/concepts/auditing-packages -->
<NuGetAudit>true</NuGetAudit>
<NuGetAuditMode>all</NuGetAuditMode>
<!-- https://learn.microsoft.com/en-us/nuget/reference/errors-and-warnings/nu1901-nu1904 -->
<WarningsAsErrors>NU1901;NU1902;NU1903;NU1904</WarningsAsErrors>
</PropertyGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0' OR '$(TargetFramework)' == 'net8.0'">
<PackageVersion Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="8.0.1" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="8.0.1" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net9.0'">
<PackageVersion Include="Microsoft.Extensions.Configuration" Version="9.0.15" />
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="9.0.15" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="9.0.15" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net10.0'">
<PackageVersion Include="Microsoft.Extensions.Configuration" Version="10.0.6" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="10.0.6" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net11.0'">
<PackageVersion Include="Microsoft.Extensions.Configuration" Version="11.0.0-preview.3.26207.106" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="11.0.0-preview.3.26207.106" />
</ItemGroup>
<ItemGroup>
<PackageVersion Include="Microsoft.CSharp" Version="4.7.0" />
<PackageVersion Include="System.Reflection.Emit" Version="4.7.0" />
<PackageVersion Include="System.ComponentModel.Annotations" Version="5.0.0" />
<PackageVersion Include="Newtonsoft.Json" Version="13.0.4" />
<PackageVersion Include="Serilog" Version="4.3.1" />
</ItemGroup>
<ItemGroup>
<PackageVersion Include="Moq" Version="4.20.72" />
<PackageVersion Include="xunit.v3.mtp-v2" Version="3.2.2" />
<PackageVersion Include="GitHubActionsTestLogger" Version="3.0.3" />
<PackageVersion Include="Microsoft.Testing.Platform" Version="2.2.1" />
<PackageVersion Include="coverlet.collector" Version="10.0.0" />
<PackageVersion Include="BenchmarkDotNet" Version="0.15.8" />
</ItemGroup>
<ItemGroup>
<PackageVersion Include="Microsoft.EntityFrameworkCore" Version="10.0.6" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.InMemory" Version="10.0.6" />
<PackageVersion Include="Microsoft.Extensions.ObjectPool" Version="10.0.6" />
<PackageVersion Include="Serilog.Sinks.Console" Version="6.1.1" />
<PackageVersion Include="Microsoft.Data.SqlClient" Version="7.0.0" />
<PackageVersion Include="Dapper" Version="2.1.72" />
</ItemGroup>
<ItemGroup>
<GlobalPackageReference Include="PolySharp" Version="1.15.0" />
</ItemGroup>
</Project>
================================================
FILE: LICENSE
================================================
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "{}"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright 2017 WeihanLi
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
================================================
FILE: README.md
================================================
# WeihanLi.Common
[](https://www.nuget.org/packages/WeihanLi.Common/)
[](https://www.nuget.org/packages/WeihanLi.Common/absoluteLatest)
[](https://weihanli.visualstudio.com/Pipelines/_build/latest?definitionId=16&branchName=master)
[](https://github.com/WeihanLi/WeihanLi.Common/actions/workflows/default.yml)
## Overview
`WeihanLi.Common` bundles a set of production-ready helpers, extensions, and middleware to simplify .NET application development. It covers dependency injection, AOP, eventing, logging, data access helpers, OTP utilities, templating, and more—built from real-world usage and battle-tested across services.
## Packages
| Package | Description |
| --- | --- |
| `WeihanLi.Common` | Core helpers and extensions: dependency resolver, configuration helpers, pipelines, TOTP utilities, command executors, etc. |
| `WeihanLi.Common.Logging.Serilog` | Integration layer so core logging abstractions seamlessly forward to Serilog or Microsoft.Extensions.Logging. |
| `WeihanLi.Extensions.Hosting` | Hosting helpers for quickly wiring background services, console apps, and DI bootstrapping. |
Each package is available on NuGet and can be referenced independently.
## Installation
Install the package you need using the .NET CLI or NuGet Package Manager:
```bash
dotnet add package WeihanLi.Common
# or install the Serilog integration
dotnet add package WeihanLi.Common.Logging.Serilog
```
Preview builds are also published; append `--version <preview>` to opt in.
## Quick Start
```csharp
using WeihanLi.Common.Helpers;
// Generate a TOTP code with the built-in helper.
var secret = $"{ApplicationHelper.ApplicationName}_demo_secret";
var code = TotpHelper.GenerateCode(secret);
Console.WriteLine($"Generated code: {code}");
var isValid = TotpHelper.ValidateCode(secret, code);
Console.WriteLine($"Valid code: {isValid}");
```
See `samples/DotNetCoreSample` and `samples/AspNetCoreSample` for richer scenarios that exercise DI decorators, event buses, logging pipelines, and more.
## Feature Highlights
- **Dependency Injection**: Lightweight container abstractions, decorator helpers, metadata-based registrations, proxy support, and integration with `Microsoft.Extensions.DependencyInjection`.
- **Fluent Aspects (AOP)**: Dynamic proxy-based interception with fluent configuration for method-level behaviors (logging, validation, caching, etc.).
- **Event Infrastructure**: In-memory and queue-backed `EventBus`, `EventStore`, and handler helpers to wire publish/subscribe workflows.
- **Logging**: Abstractions with adapters for built-in logging and Serilog plus formatting helpers to ship structured events.
- **Data Access Helpers**: Dapper-style extensions over ADO.NET, entity mapping utilities, and SQL expression parsers to streamline data access layers.
- **OTP & Security**: TOTP implementation, helpers, and service abstractions to secure user flows with minimal setup.
- **Templating & Text**: Lightweight template engine and string utility helpers for dynamic content rendering.
- **Utilities**: Process executor, pipeline builder, command helpers, configuration helpers, async invokers, and more.
## Documentation & Samples
- Browse the docs in `docs/index.md` and articles under `docs/articles` for deep dives.
- API references can be generated with DocFX (`docs/docfx.json`).
- Samples live under `samples/` and demonstrate step-by-step usage patterns you can adapt.
## Building & Testing
```bash
dotnet build
dotnet test
```
CI builds run with both Azure Pipelines (`azure-pipelines.yml`) and GitHub Actions (`.github/workflows/default.yml`), so you can rely on the same commands locally.
> Set the `DISABLE_GITHUB_ACTIONS_TEST_LOGGER` environment variable to `true` if you need to opt out of the GitHub Actions test logger integration (useful for experimenting with other reporters or diagnosing runner differences).
## Release Notes
Head to the [merged pull requests list](https://github.com/WeihanLi/WeihanLi.Common/pulls?q=is%3Apr+is%3Amerged+base%3Amaster) or the docfx [ReleaseNotes](docs/ReleaseNotes.md) for a chronological view of changes.
================================================
FILE: WeihanLi.Common.sln.DotSettings
================================================
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=CA/@EntryIndexedValue">CA</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=OS/@EntryIndexedValue">OS</s:String>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Enricher/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=sourcebranchname/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Weihan/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
================================================
FILE: WeihanLi.Common.slnx
================================================
<Solution>
<Folder Name="/perf/">
<Project Path="perf/WeihanLi.Common.Benchmark/WeihanLi.Common.Benchmark.csproj" />
</Folder>
<Folder Name="/samples/">
<Project Path="samples/AspNetCoreSample/AspNetCoreSample.csproj" />
<Project Path="samples/DotNetCoreSample/DotNetCoreSample.csproj" />
</Folder>
<Folder Name="/src/">
<Project Path="src/WeihanLi.Common.Logging.Serilog/WeihanLi.Common.Logging.Serilog.csproj" />
<Project Path="src/WeihanLi.Common/WeihanLi.Common.csproj" />
<Project Path="src/WeihanLi.Extensions.Hosting/WeihanLi.Extensions.Hosting.csproj" />
</Folder>
<Folder Name="/test/">
<Project Path="test/WeihanLi.Common.Test/WeihanLi.Common.Test.csproj" />
</Folder>
</Solution>
================================================
FILE: azure-pipelines.yml
================================================
# https://learn.microsoft.com/en-us/azure/devops/pipelines/yaml-schema/pr?view=azure-pipelines
pr: none
trigger:
branches:
include:
- 'master' # must quote since "*" is a YAML reserved character; we want a string
- 'main'
- 'preview'
- 'dev'
paths:
exclude:
- '*.md'
- 'docs'
- '.github'
- '.husky'
- '.devcontainer'
pool:
vmImage: 'windows-latest'
steps:
- task: UseDotNet@2
displayName: 'Use .NET 8 sdk'
inputs:
packageType: sdk
version: 8.0.x
- task: UseDotNet@2
displayName: 'Use .NET 9 sdk'
inputs:
packageType: sdk
version: 9.0.x
- task: UseDotNet@2
displayName: 'Use .NET 10 sdk'
inputs:
packageType: sdk
version: 10.0.x
- task: UseDotNet@2
displayName: 'Use .NET 11 sdk'
inputs:
packageType: sdk
version: 11.0.x
includePreviewVersions: true # Required for preview versions
- script: dotnet --info
displayName: 'dotnet info'
- script: dotnet build.cs
displayName: 'Build Script'
env:
NuGet__ApiKey: $(nugetApiKey)
# # Publish code coverage results v2
# # Publish any of the code coverage results from a build.
# - task: PublishCodeCoverageResults@2
# inputs:
# summaryFileLocation: "$(System.DefaultWorkingDirectory)/**/coverage.cobertura.xml" # string. Required. Path to summary files.
# #pathToSources: # string. Path to Source files.
# #failIfCoverageEmpty: false # boolean. Fail if code coverage results are missing. Default: false.
================================================
FILE: build/exportReleaseVersion.cs
================================================
var currentDirectory = Directory.GetCurrentDirectory();
Console.WriteLine($"currentDirectory: {currentDirectory}");
var versionPropsFile = "./build/version.props";
var doc = System.Xml.Linq.XDocument.Load(versionPropsFile);
var propertyGroupNode = doc.Element("Project")?.Element("PropertyGroup");
ArgumentNullException.ThrowIfNull(propertyGroupNode);
var version = $"{propertyGroupNode.Element("VersionMajor")!.Value}.{propertyGroupNode.Element("VersionMinor")!.Value}.{propertyGroupNode.Element("VersionPatch")!.Value}";
Console.WriteLine($"Version: {version}");
var envFile = Environment.GetEnvironmentVariable("GITHUB_ENV");
Console.WriteLine($"EnvFilePath: {envFile}");
if (string.IsNullOrEmpty(envFile)) return;
File.WriteAllText(envFile, $"ReleaseVersion={version}");
Console.WriteLine(File.ReadAllText(envFile));
================================================
FILE: build/sign.props
================================================
<Project>
<PropertyGroup Condition="'$(OS)' == 'Windows_NT' and '$(Configuration)' == 'Release'">
<SignAssembly>True</SignAssembly>
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)weihanli.snk</AssemblyOriginatorKeyFile>
<DelaySign>False</DelaySign>
</PropertyGroup>
</Project>
================================================
FILE: build/version.props
================================================
<Project>
<PropertyGroup>
<VersionMajor>1</VersionMajor>
<VersionMinor>0</VersionMinor>
<VersionPatch>88</VersionPatch>
<VersionPrefix>$(VersionMajor).$(VersionMinor).$(VersionPatch)</VersionPrefix>
</PropertyGroup>
</Project>
================================================
FILE: build.cs
================================================
// Copyright (c) Weihan Li. All rights reserved.
// Licensed under the Apache license version 2.0 http://www.apache.org/licenses/LICENSE-2.0
#:project ./src/WeihanLi.Common/WeihanLi.Common.csproj
#:property PublishAot=false
using WeihanLi.Common.Helpers;
var solutionPath = "./WeihanLi.Common.slnx";
string[] srcProjects = [
"./src/WeihanLi.Common/WeihanLi.Common.csproj",
"./src/WeihanLi.Common.Logging.Serilog/WeihanLi.Common.Logging.Serilog.csproj",
"./src/WeihanLi.Extensions.Hosting/WeihanLi.Extensions.Hosting.csproj",
];
string[] testProjects = [ "./test/WeihanLi.Common.Test/WeihanLi.Common.Test.csproj" ];
await DotNetPackageBuildProcess
.Create(options =>
{
options.SolutionPath = solutionPath;
options.SrcProjects = srcProjects;
options.TestProjects = testProjects;
})
.ExecuteAsync(args);
================================================
FILE: docs/.gitignore
================================================
###############
# folder #
###############
/**/DROP/
/**/TEMP/
/**/packages/
/**/bin/
/**/obj/
_site
================================================
FILE: docs/ReleaseNotes.md
================================================
# Package Release Notes
## WeihanLi.Common
See pull requests list for changes <https://github.com/WeihanLi/WeihanLi.Common/pulls?q=is%3Apr+is%3Amerged+base%3Amaster>
### [WeihanLi.Common 1.0.50](https://www.nuget.org/packages/WeihanLi.Common/1.0.50)
- Update `HttpClientExtensions` to fix extension conflict with `System.Net.Http.Json`
- Update `Validator`
### [WeihanLi.Common 1.0.49](https://www.nuget.org/packages/WeihanLi.Common/1.0.49)
- Update `HttpClientExtensions`
- Add `WrapTask`/`WrapValueTask` support
- Add `Properties`/`UseWhen` for `PipelineBuilder`
- Refactor `Result`
- Better nullable analysis
- Improve `ValueTask` support
### [WeihanLi.Common 1.0.48](https://www.nuget.org/packages/WeihanLi.Common/1.0.48)
- Fix `ValueTask` Support
- Add `MockHttpHandler`
- Remove `JetBrains.Annotations`
- Refactor on `CommandExecutor`
- Add `GetRequiredAppSetting` and `GetAppSetting` with default value
### [WeihanLi.Common 1.0.47](https://www.nuget.org/packages/WeihanLi.Common/1.0.47)
- Fix NuGet package warnings
- Add `GenericLogger`
- Add `Append[Line]If` with text factory
- Add `TenantIdProvider`
- Update `Random` for thread-safe instance
- Add `ValueAsyncPipelineBuilder`
- Add feature flags ConfigurationExtension
- Add .NET 6 target
- Fix nullable warnings
### [WeihanLi.Common 1.0.46](https://www.nuget.org/packages/WeihanLi.Common/1.0.46)
- `ConsoleLoggingProvider` implement
- `Dump` extensions
- update `ValueStopwatch`/`ProfilerHelper`
- nullable reference types enhancement
### [WeihanLi.Common 1.0.44](https://www.nuget.org/packages/WeihanLi.Common/1.0.44)
- enable nullable reference types
- add `ValueStopwatch`
- some enhancements
### [WeihanLi.Common 1.0.43](https://www.nuget.org/packages/WeihanLi.Common/1.0.43)
- refactor `RetryHelper`
- update `MapHelper`/`UnitOfWork`
### [WeihanLi.Common 1.0.42](https://www.nuget.org/packages/WeihanLi.Common/1.0.42)
- update `HashHelper`/`Exception.Unwrap`
- update `object.To` extension method, fix bug when nullable type value convert
- remove `ThreadPrincipalUserIdProvider`(may cause security issue)
### [WeihanLi.Common 1.0.41](https://www.nuget.org/packages/WeihanLi.Common/1.0.41)
- update `ConsoleOutput`
- update `IRepository`, fix #100
### [WeihanLi.Common 1.0.40](https://www.nuget.org/packages/WeihanLi.Common/1.0.40)
- add `ProcessExecutor`/`CommandRunner`/`ConsoleOutput`
- add `Base62Encoder`/`Base36Encoder`
- add `DelegateTextWriter`
- add `SequentialGuidIdGenerator`
- update `ResultModel`/`TOTP`/`ProxyUtils`/`AspectCoreExtensions`/`IdGenerator`/ logging extensions
### [WeihanLi.Common 1.0.39](https://www.nuget.org/packages/WeihanLi.Common/1.0.39)
- add `BuildFluentAspectsProvider` extensions
- add `DelegateInterceptor`
- add `NoInterceptProperty` extension
- update `IInterceptorResolver` return IReadOnlyList instead of IReadCollection
- add arguments for `IProxyFactory.CreateProxyWithTarget`
- add support for property injection support
### [WeihanLi.Common 1.0.38](https://www.nuget.org/packages/WeihanLi.Common/1.0.38)
- add `IUserIdProvider`/`ICancellationTokenProvider`
- add `NullEventSubscriptionManager`
- add biz models, `ReviewRequest` and more ...
- update `PipelineBuilder` add empty complete delegate as default
- add `JsonSerializeExtension.SerializerSettingsWith`, optimize `ToEventMsg`/`ToEvent`
- update `FluentAspect`, allow add optional constructor parameters, export FluentAspectInterceptor for Castle and AspectCore
### [WeihanLi.Common 1.0.37](https://www.nuget.org/packages/WeihanLi.Common/1.0.37)
- refact events related `EventBus`/`EventStore`/`EventQueue`/`EventPublisher`/`EventSubscriber`
- update `ResultModel`
- add `ReviewState`/`Categories`/`PagedRequest`/`BaseEntityWithDeleted`/`PagedRequest`
- add `CastleProxyTypeFactory`/`FluentAspectInterceptorSelector`
- expose `ActivateHelper` `ObjectFactory`/`FindApplicableConstructor`
### [WeihanLi.Common 1.0.36](https://www.nuget.org/packages/WeihanLi.Common/1.0.36)
- refact `FluentAspect`, add `InvocationEnricher`, fix #75
- add `IEventQueue`/`DelegateHelper`/`BaseEntity`
### [WeihanLi.Common 1.0.35](https://www.nuget.org/packages/WeihanLi.Common/1.0.35)
- add `FluentAspect` implemented AOP
- add `TimeoutAfter` extensions
### [WeihanLi.Common 1.0.34](https://www.nuget.org/packages/WeihanLi.Common/1.0.34)
- add `PipelineBuilder` to create pipeline easily
- update `TotpHelper`, fix bug when the code starts with `0`
### [WeihanLi.Common 1.0.33](https://www.nuget.org/packages/WeihanLi.Common/1.0.33)
- update `ServiceCollectionDependencyResolver` to fix generic scoped service resolve
- add `ServiceContainerDependencyResolver`
- update `DataExtension`/`DbConnectionExtension`/`DbCommandExtension` fix #9
### [WeihanLi.Common 1.0.32](https://www.nuget.org/packages/WeihanLi.Common/1.0.32)
- update di extensions, update `GetExportedTypes` with `GetTypes`
- add interface type filter for `RegisterAssemblyTypesAsImplementedInterfaces`/`RegisterTypeAsImplementedInterfaces`
- add `ActivatorHelper.CreateInstance<T>(params object[] parameters)`
- update `TotpHelper`, add check for null salt, disable backward step moving
### [WeihanLi.Common 1.0.31](https://www.nuget.org/packages/WeihanLi.Common/1.0.31)
- update `AsyncLock`, add `Lock`
- update `DependencyResolver`
- add `StringHelper.ToPascalCase`/`StringHelper.ToCamelCase`
- add `UnitOfWork`/`DelegateLoggerProvider`/`TotpOptions`
- rename `JsonToType` => `JsonToObject`(breaking change)
### [WeihanLi.Common 1.0.30](https://www.nuget.org/packages/WeihanLi.Common/1.0.30)
- update `ExpressionExtension.And`/`ExpressionExtension.Or`
- add `SqlExpressionVisitor`
- add `RegisterModule` extension for `IServiceCollection`
- add extensions for `IServiceContainerBuilder`
### [WeihanLi.Common 1.0.29](https://www.nuget.org/packages/WeihanLi.Common/1.0.29)
- add di extension
- add `StringExtension.TrimStart(this string str, string start)` extension
### [WeihanLi.Common 1.0.28](https://www.nuget.org/packages/WeihanLi.Common/1.0.28)
- refact logging
- update `JsonResultModel`/`JsonResultStatus` => `ResultModel`/`ResultStatus`
- add `NetHelper.IsPrivateIP`/`IPNetwork`
- add httpHeader parameters for `HttpHelper.HttpPostFile`
### [WeihanLi.Common 1.0.26](https://www.nuget.org/packages/WeihanLi.Common/1.0.26)
- update event, add async support for publish and subscribe/unsubscribe
- update di, add `ServiceContainerBuilder`/`ServiceContainerModule` to register service
- update cron, export `CronExpression`
- add `ArrayHelper.Empty` for net45,update `ConfigurationHelper` for netstandard2.0
### [WeihanLi.Common 1.0.25](https://www.nuget.org/packages/WeihanLi.Common/1.0.25)
- add `ValidateResultModel`
- update `PagedListModel`
- add build-in di support
### [WeihanLi.Common 1.0.24.3](https://www.nuget.org/packages/WeihanLi.Common/1.0.24.3)
- add `NetHelper.GetRandomPort`
- add `TaskHelper.CompletedTask`
- optimize `ToByteArray(this Stream @this)`/`ToByteArrayAsync(this Stream @this)`
- add `ExpressionExtension.True<T>`/`ExpressionExtension.False<T>`
### [WeihanLi.Common 1.0.24.2](https://www.nuget.org/packages/WeihanLi.Common/1.0.24.2)
- optimize `CronHelper` and `PagedListModel`
### [WeihanLi.Common 1.0.24](https://www.nuget.org/packages/WeihanLi.Common/1.0.24)
- add logging filter
- add `Distinct<T>(Func<T, T, bool> compareFunc)` extension
### [WeihanLi.Common 1.0.23.8](https://www.nuget.org/packages/WeihanLi.Common/1.0.23.8)
- add `CronHelper`/`ConcurrentSet`
- update `EventStoreInMemory`
- update logging
### [WeihanLi.Common 1.0.23.7](https://www.nuget.org/packages/WeihanLi.Common/1.0.23.7)
- add `PeriodBatching`
- update `GetValueGetter`/`GetValueSetter`
### [WeihanLi.Common 1.0.23.6](https://www.nuget.org/packages/WeihanLi.Common/1.0.23.6)
- remove `IsEmpty` for `IEventStore`
- fix `EventStore` `RemoveSubscribtion` bug
### [WeihanLi.Common 1.0.23.4](https://www.nuget.org/packages/WeihanLi.Common/1.0.23.4)
- expose `ApplicationHelper.AppRoot`
- add `IEventBus`/`IPAddressConverter`/`IPEndPointConverter`/`FuncExtension`
- update `HttpClientExtensions`/`SecurityHelper`
### [WeihanLi.Common 1.0.22](https://www.nuget.org/packages/WeihanLi.Common/1.0.22)
- add `DateTimeFormatConverter`
- add `LeftJoin` extension linq method for `IEnumerable`
- add `ActivatorHelper` to create instance
- update `Newtonsoft.Json` package version
- update `JsonResultModel`
- update `Pagedlistmodel`, fix json serialize bug
### [WeihanLi.Common 1.0.21](https://www.nuget.org/packages/WeihanLi.Common/1.0.21)
- add `CancellationToken` support for Repository and DataExtensions async operations
- optimize DataExtension remove `new()` LIMIT
### [WeihanLi.Common 1.0.20](https://www.nuget.org/packages/WeihanLi.Common/1.0.20)
- add [sourceLink](https://github.com/dotnet/sourcelink) support
- add back `SetDependencyResolver(IServiceProvider serviceProvider)` for netstandard2.0
- remove `System.Configuration.ConfigurationManager` dependency for netstandard2.0
- refact `HttpRequester`, add `HttpClientHttpRequester`/`WebRequestHttpRequester`
- add `NoProxyHttpClientHandler`
### [WeihanLi.Common 1.0.19](https://www.nuget.org/packages/WeihanLi.Common/1.0.19)
- Update `IDataSerializer` method `Desrializer` => `Deserialize`
- update HttpRequester
- update logging extensions
### [WeihanLi.Common 1.0.17](https://www.nuget.org/packages/WeihanLi.Common/1.0.17)
- Add `IDataCompressor`/`NullDataCompressor`
- Update `RetryHelper`/`TotpHelper`
### [WeihanLi.Common 1.0.15](https://www.nuget.org/packages/WeihanLi.Common/1.0.15)
- update Repository
- update `AsyncLock`
### [WeihanLi.Common 1.0.14](https://www.nuget.org/packages/WeihanLi.Common/1.0.14)
- update DataExtension, add support for DbConnection Extension select/fetch int
- refact `HttpRequestClient` => `HttpRequester` with fluent api
- add TotpHelper/ObjectId/ObjectIdGenerator
================================================
FILE: docs/api/.gitignore
================================================
###############
# temp file #
###############
*.yml
.manifest
================================================
FILE: docs/api/index.md
================================================
# PLACEHOLDER
TODO: Add .NET projects to the *src* folder and run `docfx` to generate **REAL** *API Documentation*!
================================================
FILE: docs/articles/intro.md
================================================
# Add your introductions here!
================================================
FILE: docs/articles/toc.yml
================================================
- name: Introduction
href: intro.md
================================================
FILE: docs/docfx.json
================================================
{
"metadata": [
{
"src": [
{
"files": [
"src/**.csproj"
],
"src": "../"
}
],
"dest": "api",
"includePrivateMembers": false,
"disableGitFeatures": false,
"disableDefaultFilter": false,
"noRestore": false,
"namespaceLayout": "flattened"
}
],
"build": {
"content": [
{
"files": [
"api/**.yml",
"api/index.md"
]
},
{
"files": [
"articles/**.md",
"articles/**/toc.yml",
"toc.yml",
"*.md"
]
}
],
"resource": [
{
"files": [
"images/**"
]
}
],
"overwrite": [
{
"files": [
"apidoc/**.md"
],
"exclude": [
"obj/**",
"_site/**"
]
}
],
"dest": "_site",
"globalMetadataFiles": [],
"fileMetadataFiles": [],
"template": [
"default",
"modern"
],
"postProcessors": [],
"noLangKeyword": false,
"keepFileLink": false,
"disableGitFeatures": false
}
}
================================================
FILE: docs/index.md
================================================
# WeihanLi.Common
## Build status
[](https://www.nuget.org/packages/WeihanLi.Common/)
[](https://www.nuget.org/packages/WeihanLi.Common/absoluteLatest)
## Intro
.NET 常用帮助类,扩展方法等,基础类库
## Packages
与这个 Repository 相关的 nuget 包:
- [WeihanLi.Common](https://www.nuget.org/packages/WeihanLi.Common) 基础组件
- [WeihanLi.Common.Aspect.Castle](https://www.nuget.org/packages/WeihanLi.Common.Aspect.Castle/) 基于 Castle 的 AOP 扩展
- [WeihanLi.Common.Aspect.AspectCore](https://www.nuget.org/packages/WeihanLi.Common.Aspect.Castle/) 基于 AspectCore 的 AOP 扩展(`CreateProxyWithTarget` 不支持 class)
- [WeihanLi.Data](https://www.nuget.org/packages/WeihanLi.Data) 数据库扩展
- [WeihanLi.Common.Logging.Serilog](https://www.nuget.org/packages/WeihanLi.Common.Logging.Serilog) 日志 serilog 扩展
## Features
- Dependence Injection(类比微软依赖注入框架自定义实现的依赖注入框架)
- Fluent Aspects -- AOP implemented(基于动态代理实现的 AOP 框架)
- Event Related(EventBus/EventQueue/EventStore)
- Logging Framework(结合serilog/微软日志框架实现的日志框架)
- Dapper-like Ado.Net extensions(类似 Dapper 的 Ado.Net 扩展)
- TOTP implement(TOTP算法实现)
- and more ...
## Contact
Contact me if you need: <weihanli@outlook.com>
================================================
FILE: docs/toc.yml
================================================
- name: Articles
href: articles/
- name: Api Documentation
href: api/
- name: ReleaseNotes
href: ReleaseNotes.md
- name: Github
href: https://github.com/WeihanLi/WeihanLi.Common
================================================
FILE: nuget.config
================================================
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<config>
<add key="defaultPushSource" value="nuget" />
</config>
<packageSources>
<!--To inherit the global NuGet package sources remove the <clear/> line below -->
<clear />
<add key="nuget" value="https://api.nuget.org/v3/index.json" />
</packageSources>
</configuration>
================================================
FILE: perf/WeihanLi.Common.Benchmark/BenchmarkDotNet.Artifacts/results/CreateInstanceTest-report-github.md
================================================
``` ini
BenchmarkDotNet=v0.10.14, OS=Windows 10.0.18362
Intel Core i5-6300U CPU 2.40GHz (Skylake), 1 CPU, 4 logical and 2 physical cores
.NET Core SDK=3.0.100
[Host] : .NET Core 2.1.13 (CoreCLR 4.6.28008.01, CoreFX 4.6.28008.01), 64bit RyuJIT
DefaultJob : .NET Core 2.1.13 (CoreCLR 4.6.28008.01, CoreFX 4.6.28008.01), 64bit RyuJIT
```
| Method | Mean | Error | StdDev |
|----------------------------- |----------:|-----------:|----------:|
| NewInstanceByExpression | 17.02 ns | 0.7622 ns | 2.211 ns |
| NewInstanceByReflection | 75.10 ns | 2.4788 ns | 7.032 ns |
| NewInstanceByActivatorHelper | 411.30 ns | 19.5452 ns | 57.014 ns |
| NewInstance | 15.23 ns | 1.0839 ns | 3.196 ns |
================================================
FILE: perf/WeihanLi.Common.Benchmark/BenchmarkDotNet.Artifacts/results/CreateInstanceTest-report.csv
================================================
Method,Job,AnalyzeLaunchVariance,EvaluateOverhead,MaxAbsoluteError,MaxRelativeError,MinInvokeCount,MinIterationTime,RemoveOutliers,Affinity,Jit,Platform,Runtime,AllowVeryLargeObjects,Concurrent,CpuGroups,Force,HeapAffinitizeMask,HeapCount,NoAffinitize,RetainVm,Server,Arguments,BuildConfiguration,Clock,EngineFactory,EnvironmentVariables,Toolchain,IsBaseline,InvocationCount,IterationTime,LaunchCount,RunStrategy,TargetCount,UnrollFactor,WarmupCount,Mean,Error,StdDev
NewInstanceByExpression,Default,False,Default,Default,Default,Default,Default,Default,15,RyuJit,X64,Core,False,True,False,True,Default,Default,False,False,False,Default,Default,Default,Default,Default,Default,Default,1,Default,Default,Default,Default,16,Default,17.02 ns,0.7622 ns,2.211 ns
NewInstanceByReflection,Default,False,Default,Default,Default,Default,Default,Default,15,RyuJit,X64,Core,False,True,False,True,Default,Default,False,False,False,Default,Default,Default,Default,Default,Default,Default,1,Default,Default,Default,Default,16,Default,75.10 ns,2.4788 ns,7.032 ns
NewInstanceByActivatorHelper,Default,False,Default,Default,Default,Default,Default,Default,15,RyuJit,X64,Core,False,True,False,True,Default,Default,False,False,False,Default,Default,Default,Default,Default,Default,Default,1,Default,Default,Default,Default,16,Default,411.30 ns,19.5452 ns,57.014 ns
NewInstance,Default,False,Default,Default,Default,Default,Default,Default,15,RyuJit,X64,Core,False,True,False,True,Default,Default,False,False,False,Default,Default,Default,Default,Default,Default,Default,1,Default,Default,Default,Default,16,Default,15.23 ns,1.0839 ns,3.196 ns
================================================
FILE: perf/WeihanLi.Common.Benchmark/BenchmarkDotNet.Artifacts/results/CreateInstanceTest-report.html
================================================
<!DOCTYPE html>
<html lang='en'>
<head>
<meta charset='utf-8' />
<title>CreateInstanceTest</title>
<style type="text/css">
table { border-collapse: collapse; display: block; width: 100%; overflow: auto; }
td, th { padding: 6px 13px; border: 1px solid #ddd; }
tr { background-color: #fff; border-top: 1px solid #ccc; }
tr:nth-child(even) { background: #f8f8f8; }
</style>
</head>
<body>
<pre><code>
BenchmarkDotNet=v0.10.14, OS=Windows 10.0.18362
Intel Core i5-6300U CPU 2.40GHz (Skylake), 1 CPU, 4 logical and 2 physical cores
.NET Core SDK=3.0.100
[Host] : .NET Core 2.1.13 (CoreCLR 4.6.28008.01, CoreFX 4.6.28008.01), 64bit RyuJIT
DefaultJob : .NET Core 2.1.13 (CoreCLR 4.6.28008.01, CoreFX 4.6.28008.01), 64bit RyuJIT
</code></pre>
<pre><code></code></pre>
<table>
<thead><tr><th> Method</th><th>Mean</th><th>Error</th><th>StdDev</th>
</tr>
</thead><tbody><tr><td>NewInstanceByExpression</td><td>17.02 ns</td><td>0.7622 ns</td><td>2.211 ns</td>
</tr><tr><td>NewInstanceByReflection</td><td>75.10 ns</td><td>2.4788 ns</td><td>7.032 ns</td>
</tr><tr><td>NewInstanceByActivatorHelper</td><td>411.30 ns</td><td>19.5452 ns</td><td>57.014 ns</td>
</tr><tr><td>NewInstance</td><td>15.23 ns</td><td>1.0839 ns</td><td>3.196 ns</td>
</tr></tbody></table>
</body>
</html>
================================================
FILE: perf/WeihanLi.Common.Benchmark/BenchmarkDotNet.Artifacts/results/DITest-report-github.md
================================================
``` ini
BenchmarkDotNet=v0.10.14, OS=Windows 10.0.18362
Intel Core i5-6300U CPU 2.40GHz (Skylake), 1 CPU, 4 logical and 2 physical cores
.NET Core SDK=3.0.100
[Host] : .NET Core 2.1.13 (CoreCLR 4.6.28008.01, CoreFX 4.6.28008.01), 64bit RyuJIT
Job-UURGLC : .NET Core 2.1.13 (CoreCLR 4.6.28008.01, CoreFX 4.6.28008.01), 64bit RyuJIT
RemoveOutliers=False Runtime=Core LaunchCount=3
RunStrategy=Throughput TargetCount=10 WarmupCount=5
```
| Method | Mean | Error | StdDev | Median | Op/s | Scaled | ScaledSD | Gen 0 | Allocated |
|------------------------------ |-------------:|----------:|-----------:|-------------:|--------------:|-------:|---------:|-----------:|-----------:|
| NoDI | 8.082 ns | 1.168 ns | 1.748 ns | 7.370 ns | 123,737,124.2 | 1.00 | 0.00 | 762.6953 | 1200000 B |
| Singleton | 128.733 ns | 10.401 ns | 15.568 ns | 122.103 ns | 7,768,021.0 | 16.60 | 3.78 | - | 0 B |
| Scoped | 115.224 ns | 3.434 ns | 5.139 ns | 113.493 ns | 8,678,739.2 | 14.86 | 2.94 | - | 0 B |
| Transient | 61.175 ns | 7.712 ns | 11.542 ns | 55.817 ns | 16,346,632.9 | 7.89 | 2.13 | 761.7188 | 1200000 B |
| ServiceContainerSingletonTest | 642.179 ns | 43.931 ns | 65.754 ns | 615.747 ns | 1,557,198.7 | 82.82 | 18.10 | 14437.5000 | 22800000 B |
| ServiceContainerScopedTest | 658.143 ns | 68.601 ns | 102.679 ns | 601.012 ns | 1,519,427.5 | 84.88 | 21.07 | 14468.7500 | 22800000 B |
| ServiceContainerTransientTest | 1,790.600 ns | 55.919 ns | 83.698 ns | 1,775.545 ns | 558,472.0 | 230.92 | 45.85 | 46000.0000 | 72400000 B |
================================================
FILE: perf/WeihanLi.Common.Benchmark/BenchmarkDotNet.Artifacts/results/DITest-report.csv
================================================
Method,Job,AnalyzeLaunchVariance,EvaluateOverhead,MaxAbsoluteError,MaxRelativeError,MinInvokeCount,MinIterationTime,RemoveOutliers,Affinity,Jit,Platform,Runtime,AllowVeryLargeObjects,Concurrent,CpuGroups,Force,HeapAffinitizeMask,HeapCount,NoAffinitize,RetainVm,Server,Arguments,BuildConfiguration,Clock,EngineFactory,EnvironmentVariables,Toolchain,IsBaseline,InvocationCount,IterationTime,LaunchCount,RunStrategy,TargetCount,UnrollFactor,WarmupCount,Mean,Error,StdDev,Median,Op/s,Scaled,ScaledSD,Gen 0,Allocated
NoDI,Default,False,Default,Default,Default,Default,Default,False,15,RyuJit,X64,Core,False,True,False,True,Default,Default,False,False,False,Default,Default,Default,Default,Default,Default,Default,1,Default,3,Throughput,10,16,5,8.082 ns,1.168 ns,1.748 ns,7.370 ns,"123,737,124.2",1.00,0.00,762.6953,1200000 B
Singleton,Default,False,Default,Default,Default,Default,Default,False,15,RyuJit,X64,Core,False,True,False,True,Default,Default,False,False,False,Default,Default,Default,Default,Default,Default,Default,1,Default,3,Throughput,10,16,5,128.733 ns,10.401 ns,15.568 ns,122.103 ns,"7,768,021.0",16.60,3.78,-,0 B
Scoped,Default,False,Default,Default,Default,Default,Default,False,15,RyuJit,X64,Core,False,True,False,True,Default,Default,False,False,False,Default,Default,Default,Default,Default,Default,Default,1,Default,3,Throughput,10,16,5,115.224 ns,3.434 ns,5.139 ns,113.493 ns,"8,678,739.2",14.86,2.94,-,0 B
Transient,Default,False,Default,Default,Default,Default,Default,False,15,RyuJit,X64,Core,False,True,False,True,Default,Default,False,False,False,Default,Default,Default,Default,Default,Default,Default,1,Default,3,Throughput,10,16,5,61.175 ns,7.712 ns,11.542 ns,55.817 ns,"16,346,632.9",7.89,2.13,761.7188,1200000 B
ServiceContainerSingletonTest,Default,False,Default,Default,Default,Default,Default,False,15,RyuJit,X64,Core,False,True,False,True,Default,Default,False,False,False,Default,Default,Default,Default,Default,Default,Default,1,Default,3,Throughput,10,16,5,642.179 ns,43.931 ns,65.754 ns,615.747 ns,"1,557,198.7",82.82,18.10,14437.5000,22800000 B
ServiceContainerScopedTest,Default,False,Default,Default,Default,Default,Default,False,15,RyuJit,X64,Core,False,True,False,True,Default,Default,False,False,False,Default,Default,Default,Default,Default,Default,Default,1,Default,3,Throughput,10,16,5,658.143 ns,68.601 ns,102.679 ns,601.012 ns,"1,519,427.5",84.88,21.07,14468.7500,22800000 B
ServiceContainerTransientTest,Default,False,Default,Default,Default,Default,Default,False,15,RyuJit,X64,Core,False,True,False,True,Default,Default,False,False,False,Default,Default,Default,Default,Default,Default,Default,1,Default,3,Throughput,10,16,5,"1,790.600 ns",55.919 ns,83.698 ns,"1,775.545 ns","558,472.0",230.92,45.85,46000.0000,72400000 B
================================================
FILE: perf/WeihanLi.Common.Benchmark/BenchmarkDotNet.Artifacts/results/DITest-report.html
================================================
<!DOCTYPE html>
<html lang='en'>
<head>
<meta charset='utf-8' />
<title>DITest</title>
<style type="text/css">
table { border-collapse: collapse; display: block; width: 100%; overflow: auto; }
td, th { padding: 6px 13px; border: 1px solid #ddd; }
tr { background-color: #fff; border-top: 1px solid #ccc; }
tr:nth-child(even) { background: #f8f8f8; }
</style>
</head>
<body>
<pre><code>
BenchmarkDotNet=v0.10.14, OS=Windows 10.0.18362
Intel Core i5-6300U CPU 2.40GHz (Skylake), 1 CPU, 4 logical and 2 physical cores
.NET Core SDK=3.0.100
[Host] : .NET Core 2.1.13 (CoreCLR 4.6.28008.01, CoreFX 4.6.28008.01), 64bit RyuJIT
Job-UURGLC : .NET Core 2.1.13 (CoreCLR 4.6.28008.01, CoreFX 4.6.28008.01), 64bit RyuJIT
</code></pre>
<pre><code>RemoveOutliers=False Runtime=Core LaunchCount=3
RunStrategy=Throughput TargetCount=10 WarmupCount=5
</code></pre>
<table>
<thead><tr><th> Method</th><th> Mean</th><th>Error</th><th>StdDev</th><th>Median</th><th> Op/s</th><th>Scaled</th><th>ScaledSD</th><th>Gen 0</th><th>Allocated</th>
</tr>
</thead><tbody><tr><td>NoDI</td><td>8.082 ns</td><td>1.168 ns</td><td>1.748 ns</td><td>7.370 ns</td><td>123,737,124.2</td><td>1.00</td><td>0.00</td><td>762.6953</td><td>1200000 B</td>
</tr><tr><td>Singleton</td><td>128.733 ns</td><td>10.401 ns</td><td>15.568 ns</td><td>122.103 ns</td><td>7,768,021.0</td><td>16.60</td><td>3.78</td><td>-</td><td>0 B</td>
</tr><tr><td>Scoped</td><td>115.224 ns</td><td>3.434 ns</td><td>5.139 ns</td><td>113.493 ns</td><td>8,678,739.2</td><td>14.86</td><td>2.94</td><td>-</td><td>0 B</td>
</tr><tr><td>Transient</td><td>61.175 ns</td><td>7.712 ns</td><td>11.542 ns</td><td>55.817 ns</td><td>16,346,632.9</td><td>7.89</td><td>2.13</td><td>761.7188</td><td>1200000 B</td>
</tr><tr><td>ServiceContainerSingletonTest</td><td>642.179 ns</td><td>43.931 ns</td><td>65.754 ns</td><td>615.747 ns</td><td>1,557,198.7</td><td>82.82</td><td>18.10</td><td>14437.5000</td><td>22800000 B</td>
</tr><tr><td>ServiceContainerScopedTest</td><td>658.143 ns</td><td>68.601 ns</td><td>102.679 ns</td><td>601.012 ns</td><td>1,519,427.5</td><td>84.88</td><td>21.07</td><td>14468.7500</td><td>22800000 B</td>
</tr><tr><td>ServiceContainerTransientTest</td><td>1,790.600 ns</td><td>55.919 ns</td><td>83.698 ns</td><td>1,775.545 ns</td><td>558,472.0</td><td>230.92</td><td>45.85</td><td>46000.0000</td><td>72400000 B</td>
</tr></tbody></table>
</body>
</html>
================================================
FILE: perf/WeihanLi.Common.Benchmark/BenchmarkDotNet.Artifacts/results/WeihanLi.Common.Benchmark.DITest-report-github.md
================================================
``` ini
BenchmarkDotNet=v0.12.0, OS=Windows 10.0.18362
Intel Core i5-3470 CPU 3.20GHz (Ivy Bridge), 1 CPU, 4 logical and 4 physical cores
.NET Core SDK=3.0.100
[Host] : .NET Core 2.1.13 (CoreCLR 4.6.28008.01, CoreFX 4.6.28008.01), X64 RyuJIT
DefaultJob : .NET Core 2.1.13 (CoreCLR 4.6.28008.01, CoreFX 4.6.28008.01), X64 RyuJIT
```
| Method | Mean | Error | StdDev | Op/s | Ratio | RatioSD | Gen 0 | Gen 1 | Gen 2 | Allocated |
|------------------------------ |-----------:|----------:|----------:|--------------:|-------:|--------:|-------:|------:|------:|----------:|
| NoDI | 6.294 ns | 0.0800 ns | 0.0748 ns | 158,885,471.4 | 1.00 | 0.00 | 0.0076 | - | - | 24 B |
| Singleton | 100.930 ns | 0.3708 ns | 0.3468 ns | 9,907,897.6 | 16.04 | 0.17 | - | - | - | - |
| Transient | 49.680 ns | 0.5275 ns | 0.4934 ns | 20,128,957.4 | 7.89 | 0.10 | 0.0076 | - | - | 24 B |
| ServiceContainerSingletonTest | 348.255 ns | 6.6019 ns | 6.1754 ns | 2,871,459.3 | 55.34 | 1.33 | 0.1169 | - | - | 368 B |
| ServiceContainerTransientTest | 841.700 ns | 1.9591 ns | 1.7367 ns | 1,188,072.3 | 133.68 | 1.66 | 0.2533 | - | - | 800 B |
================================================
FILE: perf/WeihanLi.Common.Benchmark/BenchmarkDotNet.Artifacts/results/WeihanLi.Common.Benchmark.DITest-report.csv
================================================
Method,Job,AnalyzeLaunchVariance,EvaluateOverhead,MaxAbsoluteError,MaxRelativeError,MinInvokeCount,MinIterationTime,OutlierMode,Affinity,EnvironmentVariables,Jit,Platform,PowerPlanMode,Runtime,AllowVeryLargeObjects,Concurrent,CpuGroups,Force,HeapAffinitizeMask,HeapCount,NoAffinitize,RetainVm,Server,Arguments,BuildConfiguration,Clock,EngineFactory,NuGetReferences,Toolchain,IsMutator,InvocationCount,IterationCount,IterationTime,LaunchCount,MaxIterationCount,MaxWarmupIterationCount,MinIterationCount,MinWarmupIterationCount,RunStrategy,UnrollFactor,WarmupCount,Mean,Error,StdDev,Op/s,Ratio,RatioSD,Gen 0,Gen 1,Gen 2,Allocated
NoDI,Default,False,Default,Default,Default,Default,Default,Default,1111,Empty,RyuJit,X64,8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c,.NET Core 2.1,False,True,False,True,Default,Default,False,False,False,Default,Default,Default,Default,Default,Default,Default,1,Default,Default,Default,Default,Default,Default,Default,Default,16,Default,6.294 ns,0.0800 ns,0.0748 ns,"158,885,471.4",1.00,0.00,0.0076,0.0000,0.0000,24 B
Singleton,Default,False,Default,Default,Default,Default,Default,Default,1111,Empty,RyuJit,X64,8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c,.NET Core 2.1,False,True,False,True,Default,Default,False,False,False,Default,Default,Default,Default,Default,Default,Default,1,Default,Default,Default,Default,Default,Default,Default,Default,16,Default,100.930 ns,0.3708 ns,0.3468 ns,"9,907,897.6",16.04,0.17,0.0000,0.0000,0.0000,0 B
Transient,Default,False,Default,Default,Default,Default,Default,Default,1111,Empty,RyuJit,X64,8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c,.NET Core 2.1,False,True,False,True,Default,Default,False,False,False,Default,Default,Default,Default,Default,Default,Default,1,Default,Default,Default,Default,Default,Default,Default,Default,16,Default,49.680 ns,0.5275 ns,0.4934 ns,"20,128,957.4",7.89,0.10,0.0076,0.0000,0.0000,24 B
ServiceContainerSingletonTest,Default,False,Default,Default,Default,Default,Default,Default,1111,Empty,RyuJit,X64,8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c,.NET Core 2.1,False,True,False,True,Default,Default,False,False,False,Default,Default,Default,Default,Default,Default,Default,1,Default,Default,Default,Default,Default,Default,Default,Default,16,Default,348.255 ns,6.6019 ns,6.1754 ns,"2,871,459.3",55.34,1.33,0.1169,0.0000,0.0000,368 B
ServiceContainerTransientTest,Default,False,Default,Default,Default,Default,Default,Default,1111,Empty,RyuJit,X64,8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c,.NET Core 2.1,False,True,False,True,Default,Default,False,False,False,Default,Default,Default,Default,Default,Default,Default,1,Default,Default,Default,Default,Default,Default,Default,Default,16,Default,841.700 ns,1.9591 ns,1.7367 ns,"1,188,072.3",133.68,1.66,0.2533,0.0000,0.0000,800 B
================================================
FILE: perf/WeihanLi.Common.Benchmark/BenchmarkDotNet.Artifacts/results/WeihanLi.Common.Benchmark.DITest-report.html
================================================
<!DOCTYPE html>
<html lang='en'>
<head>
<meta charset='utf-8' />
<title>WeihanLi.Common.Benchmark.DITest-20191125-101726</title>
<style type="text/css">
table { border-collapse: collapse; display: block; width: 100%; overflow: auto; }
td, th { padding: 6px 13px; border: 1px solid #ddd; text-align: right; }
tr { background-color: #fff; border-top: 1px solid #ccc; }
tr:nth-child(even) { background: #f8f8f8; }
</style>
</head>
<body>
<pre><code>
BenchmarkDotNet=v0.12.0, OS=Windows 10.0.18362
Intel Core i5-3470 CPU 3.20GHz (Ivy Bridge), 1 CPU, 4 logical and 4 physical cores
.NET Core SDK=3.0.100
[Host] : .NET Core 2.1.13 (CoreCLR 4.6.28008.01, CoreFX 4.6.28008.01), X64 RyuJIT
DefaultJob : .NET Core 2.1.13 (CoreCLR 4.6.28008.01, CoreFX 4.6.28008.01), X64 RyuJIT
</code></pre>
<pre><code></code></pre>
<table>
<thead><tr><th> Method</th><th>Mean</th><th>Error</th><th>StdDev</th><th> Op/s</th><th>Ratio</th><th>RatioSD</th><th>Gen 0</th><th>Gen 1</th><th>Gen 2</th><th>Allocated</th>
</tr>
</thead><tbody><tr><td>NoDI</td><td>6.294 ns</td><td>0.0800 ns</td><td>0.0748 ns</td><td>158,885,471.4</td><td>1.00</td><td>0.00</td><td>0.0076</td><td>-</td><td>-</td><td>24 B</td>
</tr><tr><td>Singleton</td><td>100.930 ns</td><td>0.3708 ns</td><td>0.3468 ns</td><td>9,907,897.6</td><td>16.04</td><td>0.17</td><td>-</td><td>-</td><td>-</td><td>-</td>
</tr><tr><td>Transient</td><td>49.680 ns</td><td>0.5275 ns</td><td>0.4934 ns</td><td>20,128,957.4</td><td>7.89</td><td>0.10</td><td>0.0076</td><td>-</td><td>-</td><td>24 B</td>
</tr><tr><td>ServiceContainerSingletonTest</td><td>348.255 ns</td><td>6.6019 ns</td><td>6.1754 ns</td><td>2,871,459.3</td><td>55.34</td><td>1.33</td><td>0.1169</td><td>-</td><td>-</td><td>368 B</td>
</tr><tr><td>ServiceContainerTransientTest</td><td>841.700 ns</td><td>1.9591 ns</td><td>1.7367 ns</td><td>1,188,072.3</td><td>133.68</td><td>1.66</td><td>0.2533</td><td>-</td><td>-</td><td>800 B</td>
</tr></tbody></table>
</body>
</html>
================================================
FILE: perf/WeihanLi.Common.Benchmark/BenchmarkDotNet.Artifacts/results/WeihanLi.Common.Benchmark.MapperTest-report-github.md
================================================
``` ini
BenchmarkDotNet=v0.12.1, OS=Windows 10.0.19041.610 (2004/?/20H1)
Intel Core i5-6300U CPU 2.40GHz (Skylake), 1 CPU, 4 logical and 2 physical cores
.NET Core SDK=5.0.100-rc.2.20479.15
[Host] : .NET Core 3.1.9 (CoreCLR 4.700.20.47201, CoreFX 4.700.20.47203), X64 RyuJIT
DefaultJob : .NET Core 3.1.9 (CoreCLR 4.700.20.47201, CoreFX 4.700.20.47203), X64 RyuJIT
```
| Method | Mean | Error | StdDev | Median | Ratio | RatioSD |
|-------------------- |-----------:|---------:|---------:|-----------:|------:|--------:|
| AutoMapperBenchmark | 167.6 ns | 4.51 ns | 12.57 ns | 161.4 ns | 1.00 | 0.00 |
| MapHelperBenchmark | 4,335.0 ns | 26.20 ns | 23.22 ns | 4,332.7 ns | 26.31 | 1.22 |
================================================
FILE: perf/WeihanLi.Common.Benchmark/BenchmarkDotNet.Artifacts/results/WeihanLi.Common.Benchmark.MapperTest-report.csv
================================================
Method,Job,AnalyzeLaunchVariance,EvaluateOverhead,MaxAbsoluteError,MaxRelativeError,MinInvokeCount,MinIterationTime,OutlierMode,Affinity,EnvironmentVariables,Jit,Platform,PowerPlanMode,Runtime,AllowVeryLargeObjects,Concurrent,CpuGroups,Force,HeapAffinitizeMask,HeapCount,NoAffinitize,RetainVm,Server,Arguments,BuildConfiguration,Clock,EngineFactory,NuGetReferences,Toolchain,IsMutator,InvocationCount,IterationCount,IterationTime,LaunchCount,MaxIterationCount,MaxWarmupIterationCount,MinIterationCount,MinWarmupIterationCount,RunStrategy,UnrollFactor,WarmupCount,Mean,Error,StdDev,Median,Ratio,RatioSD
AutoMapperBenchmark,DefaultJob,False,Default,Default,Default,Default,Default,Default,1111,Empty,RyuJit,X64,8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c,.NET Core 3.1,False,True,False,True,Default,Default,False,False,False,Default,Default,Default,Default,Default,Default,Default,1,Default,Default,Default,Default,Default,Default,Default,Default,16,Default,167.6 ns,4.51 ns,12.57 ns,161.4 ns,1.00,0.00
MapHelperBenchmark,DefaultJob,False,Default,Default,Default,Default,Default,Default,1111,Empty,RyuJit,X64,8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c,.NET Core 3.1,False,True,False,True,Default,Default,False,False,False,Default,Default,Default,Default,Default,Default,Default,1,Default,Default,Default,Default,Default,Default,Default,Default,16,Default,"4,335.0 ns",26.20 ns,23.22 ns,"4,332.7 ns",26.31,1.22
================================================
FILE: perf/WeihanLi.Common.Benchmark/BenchmarkDotNet.Artifacts/results/WeihanLi.Common.Benchmark.MapperTest-report.html
================================================
<!DOCTYPE html>
<html lang='en'>
<head>
<meta charset='utf-8' />
<title>WeihanLi.Common.Benchmark.MapperTest-20201107-234017</title>
<style type="text/css">
table { border-collapse: collapse; display: block; width: 100%; overflow: auto; }
td, th { padding: 6px 13px; border: 1px solid #ddd; text-align: right; }
tr { background-color: #fff; border-top: 1px solid #ccc; }
tr:nth-child(even) { background: #f8f8f8; }
</style>
</head>
<body>
<pre><code>
BenchmarkDotNet=v0.12.1, OS=Windows 10.0.19041.610 (2004/?/20H1)
Intel Core i5-6300U CPU 2.40GHz (Skylake), 1 CPU, 4 logical and 2 physical cores
.NET Core SDK=5.0.100-rc.2.20479.15
[Host] : .NET Core 3.1.9 (CoreCLR 4.700.20.47201, CoreFX 4.700.20.47203), X64 RyuJIT
DefaultJob : .NET Core 3.1.9 (CoreCLR 4.700.20.47201, CoreFX 4.700.20.47203), X64 RyuJIT
</code></pre>
<pre><code></code></pre>
<table>
<thead><tr><th> Method</th><th>Mean</th><th>Error</th><th>StdDev</th><th>Median</th><th>Ratio</th><th>RatioSD</th>
</tr>
</thead><tbody><tr><td>AutoMapperBenchmark</td><td>167.6 ns</td><td>4.51 ns</td><td>12.57 ns</td><td>161.4 ns</td><td>1.00</td><td>0.00</td>
</tr><tr><td>MapHelperBenchmark</td><td>4,335.0 ns</td><td>26.20 ns</td><td>23.22 ns</td><td>4,332.7 ns</td><td>26.31</td><td>1.22</td>
</tr></tbody></table>
</body>
</html>
================================================
FILE: perf/WeihanLi.Common.Benchmark/BenchmarkDotNet.Artifacts/results/WeihanLi.Common.Benchmark.PipelineTest-report-github.md
================================================
``` ini
BenchmarkDotNet=v0.13.1, OS=Windows 10.0.22581
Intel Core i5-6300U CPU 2.40GHz (Skylake), 1 CPU, 4 logical and 2 physical cores
.NET SDK=7.0.100-preview.2.22153.17
[Host] : .NET 6.0.3 (6.0.322.12309), X64 RyuJIT
DefaultJob : .NET 6.0.3 (6.0.322.12309), X64 RyuJIT
```
| Method | Mean | Error | StdDev | Median | Gen 0 | Allocated |
|------------------------ |-------------:|-----------:|-----------:|-------------:|-----------:|----------:|
| ValueTaskPipeline | 18.69 μs | 1.402 μs | 4.133 μs | 16.55 μs | 19.3176 | 30 KB |
| ValueTaskPipelineInvoke | 21,669.82 μs | 403.984 μs | 449.027 μs | 21,635.27 μs | 19875.0000 | 30,470 KB |
| TaskPipeline | 14.00 μs | 0.279 μs | 0.443 μs | 13.87 μs | 19.3329 | 30 KB |
| TaskPipelineInvoke | 17,902.60 μs | 346.586 μs | 508.021 μs | 17,881.09 μs | 19875.0000 | 30,470 KB |
================================================
FILE: perf/WeihanLi.Common.Benchmark/BenchmarkDotNet.Artifacts/results/WeihanLi.Common.Benchmark.PipelineTest-report.csv
================================================
Method,Job,AnalyzeLaunchVariance,EvaluateOverhead,MaxAbsoluteError,MaxRelativeError,MinInvokeCount,MinIterationTime,OutlierMode,Affinity,EnvironmentVariables,Jit,Platform,PowerPlanMode,Runtime,AllowVeryLargeObjects,Concurrent,CpuGroups,Force,HeapAffinitizeMask,HeapCount,NoAffinitize,RetainVm,Server,Arguments,BuildConfiguration,Clock,EngineFactory,NuGetReferences,Toolchain,IsMutator,InvocationCount,IterationCount,IterationTime,LaunchCount,MaxIterationCount,MaxWarmupIterationCount,MemoryRandomization,MinIterationCount,MinWarmupIterationCount,RunStrategy,UnrollFactor,WarmupCount,Mean,Error,StdDev,Median,Gen 0,Allocated
ValueTaskPipeline,DefaultJob,False,Default,Default,Default,Default,Default,Default,1111,Empty,RyuJit,X64,8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c,.NET 6.0,False,True,False,True,Default,Default,False,False,False,Default,Default,Default,Default,Default,Default,Default,1,Default,Default,Default,Default,Default,Default,Default,Default,Default,16,Default,18.69 μs,1.402 μs,4.133 μs,16.55 μs,19.3176,30 KB
ValueTaskPipelineInvoke,DefaultJob,False,Default,Default,Default,Default,Default,Default,1111,Empty,RyuJit,X64,8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c,.NET 6.0,False,True,False,True,Default,Default,False,False,False,Default,Default,Default,Default,Default,Default,Default,1,Default,Default,Default,Default,Default,Default,Default,Default,Default,16,Default,"21,669.82 μs",403.984 μs,449.027 μs,"21,635.27 μs",19875.0000,"30,470 KB"
TaskPipeline,DefaultJob,False,Default,Default,Default,Default,Default,Default,1111,Empty,RyuJit,X64,8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c,.NET 6.0,False,True,False,True,Default,Default,False,False,False,Default,Default,Default,Default,Default,Default,Default,1,Default,Default,Default,Default,Default,Default,Default,Default,Default,16,Default,14.00 μs,0.279 μs,0.443 μs,13.87 μs,19.3329,30 KB
TaskPipelineInvoke,DefaultJob,False,Default,Default,Default,Default,Default,Default,1111,Empty,RyuJit,X64,8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c,.NET 6.0,False,True,False,True,Default,Default,False,False,False,Default,Default,Default,Default,Default,Default,Default,1,Default,Default,Default,Default,Default,Default,Default,Default,Default,16,Default,"17,902.60 μs",346.586 μs,508.021 μs,"17,881.09 μs",19875.0000,"30,470 KB"
================================================
FILE: perf/WeihanLi.Common.Benchmark/BenchmarkDotNet.Artifacts/results/WeihanLi.Common.Benchmark.PipelineTest-report.html
================================================
<!DOCTYPE html>
<html lang='en'>
<head>
<meta charset='utf-8' />
<title>WeihanLi.Common.Benchmark.PipelineTest-20220404-002449</title>
<style type="text/css">
table { border-collapse: collapse; display: block; width: 100%; overflow: auto; }
td, th { padding: 6px 13px; border: 1px solid #ddd; text-align: right; }
tr { background-color: #fff; border-top: 1px solid #ccc; }
tr:nth-child(even) { background: #f8f8f8; }
</style>
</head>
<body>
<pre><code>
BenchmarkDotNet=v0.13.1, OS=Windows 10.0.22581
Intel Core i5-6300U CPU 2.40GHz (Skylake), 1 CPU, 4 logical and 2 physical cores
.NET SDK=7.0.100-preview.2.22153.17
[Host] : .NET 6.0.3 (6.0.322.12309), X64 RyuJIT
DefaultJob : .NET 6.0.3 (6.0.322.12309), X64 RyuJIT
</code></pre>
<pre><code></code></pre>
<table>
<thead><tr><th> Method</th><th> Mean</th><th>Error</th><th>StdDev</th><th>Median</th><th>Gen 0</th><th>Allocated</th>
</tr>
</thead><tbody><tr><td>ValueTaskPipeline</td><td>18.69 μs</td><td>1.402 μs</td><td>4.133 μs</td><td>16.55 μs</td><td>19.3176</td><td>30 KB</td>
</tr><tr><td>ValueTaskPipelineInvoke</td><td>21,669.82 μs</td><td>403.984 μs</td><td>449.027 μs</td><td>21,635.27 μs</td><td>19875.0000</td><td>30,470 KB</td>
</tr><tr><td>TaskPipeline</td><td>14.00 μs</td><td>0.279 μs</td><td>0.443 μs</td><td>13.87 μs</td><td>19.3329</td><td>30 KB</td>
</tr><tr><td>TaskPipelineInvoke</td><td>17,902.60 μs</td><td>346.586 μs</td><td>508.021 μs</td><td>17,881.09 μs</td><td>19875.0000</td><td>30,470 KB</td>
</tr></tbody></table>
</body>
</html>
================================================
FILE: perf/WeihanLi.Common.Benchmark/DITest.cs
================================================
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Columns;
using BenchmarkDotNet.Configs;
using BenchmarkDotNet.Diagnosers;
using BenchmarkDotNet.Validators;
using Microsoft.Extensions.DependencyInjection;
using System.Runtime.CompilerServices;
using WeihanLi.Common.DependencyInjection;
namespace WeihanLi.Common.Benchmark;
// https://github.com/aspnet/DependencyInjection/blob/rel/2.0.0/test/Microsoft.Extensions.DependencyInjection.Performance/GetServiceBenchmark.cs
[Config(typeof(CoreConfig))]
public class DITest
{
// refer to https://github.com/aspnet/DependencyInjection/blob/rel/2.0.0/test/Microsoft.Extensions.DependencyInjection.Performance/configs/CoreConfig.cs
private class CoreConfig : ManualConfig
{
public CoreConfig()
{
AddValidator(JitOptimizationsValidator.FailOnError);
AddDiagnoser(MemoryDiagnoser.Default);
AddColumn(StatisticColumn.OperationsPerSecond);
}
}
private const int OperationsPerInvoke = 50000;
private IServiceProvider _transientSp;
private IServiceScope _scopedSp;
private IServiceProvider _singletonSp;
private IServiceContainer _singletonContainer;
private IServiceContainer _scopedRootContainer;
private IServiceContainer _scopedContainer;
private IServiceContainer _transientContainer;
[GlobalSetup]
public void Setup()
{
var services = new ServiceCollection();
services.AddSingleton<A>();
services.AddSingleton<B>();
services.AddSingleton<C>();
_singletonSp = services.BuildServiceProvider();
services = new ServiceCollection();
services.AddScoped<A>();
services.AddScoped<B>();
services.AddScoped<C>();
_scopedSp = services.BuildServiceProvider().CreateScope();
services = new ServiceCollection();
services.AddTransient<A>();
services.AddTransient<B>();
services.AddTransient<C>();
_transientSp = services.BuildServiceProvider();
var containerBuilder = new ServiceContainerBuilder();
containerBuilder.AddSingleton<A>();
containerBuilder.AddSingleton<B>();
containerBuilder.AddSingleton<C>();
_singletonContainer = containerBuilder.Build();
containerBuilder = new ServiceContainerBuilder();
containerBuilder.AddScoped<A>();
containerBuilder.AddScoped<B>();
containerBuilder.AddScoped<C>();
_scopedRootContainer = containerBuilder.Build();
_scopedContainer = _scopedRootContainer.CreateScope();
containerBuilder = new ServiceContainerBuilder();
containerBuilder.AddTransient<A>();
containerBuilder.AddTransient<B>();
containerBuilder.AddTransient<C>();
_transientContainer = containerBuilder.Build();
}
[GlobalCleanup]
public void Cleanup()
{
_singletonContainer?.Dispose();
_scopedRootContainer?.Dispose();
_scopedContainer?.Dispose();
_transientContainer?.Dispose();
}
[Benchmark(Baseline = true, OperationsPerInvoke = OperationsPerInvoke)]
public void NoDI()
{
for (var i = 0; i < OperationsPerInvoke; i++)
{
var temp = new A(new B(new C()));
temp.Foo();
}
}
//[Benchmark(OperationsPerInvoke = OperationsPerInvoke)]
//public void Reflection()
//{
// for (var i = 0; i < OperationsPerInvoke; i++)
// {
// var temp = (A)Activator.CreateInstance(typeof(A),
// Activator.CreateInstance(typeof(B),
// Activator.CreateInstance(typeof(C))))
// ;
// temp.Foo();
// }
//}
[Benchmark(OperationsPerInvoke = OperationsPerInvoke)]
public void Singleton()
{
for (var i = 0; i < OperationsPerInvoke; i++)
{
var temp = _singletonSp.GetService<A>();
temp.Foo();
}
}
//[Benchmark(OperationsPerInvoke = OperationsPerInvoke)]
//public void Scoped()
//{
// for (var i = 0; i < OperationsPerInvoke; i++)
// {
// var temp = _scopedSp.ServiceProvider.GetService<A>();
// temp.Foo();
// }
//}
[Benchmark(OperationsPerInvoke = OperationsPerInvoke)]
public void Transient()
{
for (var i = 0; i < OperationsPerInvoke; i++)
{
var temp = _transientSp.GetService<A>();
temp.Foo();
}
}
[Benchmark(OperationsPerInvoke = OperationsPerInvoke)]
public void ServiceContainerSingletonTest()
{
for (var i = 0; i < OperationsPerInvoke; i++)
{
var temp = _singletonContainer.GetService<A>();
temp.Foo();
}
}
//[Benchmark(OperationsPerInvoke = OperationsPerInvoke)]
//public void ServiceContainerScopedTest()
//{
// for (var i = 0; i < OperationsPerInvoke; i++)
// {
// var temp = _scopedContainer.GetService<A>();
// temp.Foo();
// }
//}
[Benchmark(OperationsPerInvoke = OperationsPerInvoke)]
public void ServiceContainerTransientTest()
{
for (var i = 0; i < OperationsPerInvoke; i++)
{
var temp = _transientContainer.GetService<A>();
temp.Foo();
}
}
private class A
{
public A(B b)
{
}
[MethodImpl(MethodImplOptions.NoInlining)]
public void Foo()
{
}
}
private class B
{
public B(C c)
{
}
}
private class C
{
}
}
================================================
FILE: perf/WeihanLi.Common.Benchmark/PipelineTest.cs
================================================
// Copyright (c) Weihan Li. All rights reserved.
// Licensed under the Apache license.
using BenchmarkDotNet.Attributes;
using System.Diagnostics;
using WeihanLi.Common.Helpers;
namespace WeihanLi.Common.Benchmark;
[MemoryDiagnoser]
public class PipelineTest
{
private sealed class TestContext
{
}
[Benchmark]
public async Task ValueTaskPipeline()
{
var builder = PipelineBuilder.CreateValueAsync<TestContext>();
for (var i = 0; i < 100; i++)
{
builder.Use(async (context, next) =>
{
Debug.WriteLine(context.GetHashCode());
await next();
});
}
var pipeline = builder.Build();
var context = new TestContext();
await pipeline(context);
}
[Benchmark]
public async Task ValueTaskPipelineInvoke()
{
var builder = PipelineBuilder.CreateValueAsync<TestContext>();
builder.Use(async (context, next) =>
{
Debug.WriteLine(context.GetHashCode());
await next();
});
builder.Use(async (context, next) =>
{
Debug.WriteLine(context.GetHashCode());
await next();
});
builder.Use(async (context, next) =>
{
Debug.WriteLine(context.GetHashCode());
await next();
});
var pipeline = builder.Build();
for (var i = 0; i < 100000; i++)
{
var context = new TestContext();
await pipeline(context);
}
}
[Benchmark]
public async Task TaskPipeline()
{
var builder = PipelineBuilder.CreateAsync<TestContext>();
for (var i = 0; i < 100; i++)
{
builder.Use(async (context, next) =>
{
Debug.WriteLine(context.GetHashCode());
await next();
});
}
var pipeline = builder.Build();
var context = new TestContext();
await pipeline(context);
}
[Benchmark]
public async Task TaskPipelineInvoke()
{
var builder = PipelineBuilder.CreateAsync<TestContext>();
builder.Use(async (context, next) =>
{
Debug.WriteLine(context.GetHashCode());
await next();
});
builder.Use(async (context, next) =>
{
Debug.WriteLine(context.GetHashCode());
await next();
});
builder.Use(async (context, next) =>
{
Debug.WriteLine(context.GetHashCode());
await next();
});
var pipeline = builder.Build();
for (var i = 0; i < 100000; i++)
{
var context = new TestContext();
await pipeline(context);
}
}
}
================================================
FILE: perf/WeihanLi.Common.Benchmark/Program.cs
================================================
using BenchmarkDotNet.Running;
namespace WeihanLi.Common.Benchmark;
public class Program
{
public static void Main(string[] args)
{
// BenchmarkRunner.Run<MapperTest>();
// BenchmarkRunner.Run<CreateInstanceTest>();
// BenchmarkRunner.Run<DITest>();
BenchmarkRunner.Run<PipelineTest>();
Console.ReadLine();
}
}
================================================
FILE: perf/WeihanLi.Common.Benchmark/WeihanLi.Common.Benchmark.csproj
================================================
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>$(LatestTargetFramework)</TargetFramework>
<OutputType>Exe</OutputType>
<Optimize>true</Optimize>
<Benchmark>True</Benchmark>
<Nullable>disable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="BenchmarkDotNet" />
<PackageReference Include="Dapper" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\WeihanLi.Common\WeihanLi.Common.csproj" />
</ItemGroup>
</Project>
================================================
FILE: samples/AspNetCoreSample/AspNetCoreSample.csproj
================================================
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>$(LatestTargetFramework)</TargetFramework>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\WeihanLi.Common\WeihanLi.Common.csproj" />
</ItemGroup>
</Project>
================================================
FILE: samples/AspNetCoreSample/Controllers/EventsController.cs
================================================
using AspNetCoreSample.Events;
using Microsoft.AspNetCore.Mvc;
namespace AspNetCoreSample.Controllers;
[Route("api/[controller]")]
public class EventsController : ControllerBase
{
[HttpGet("pageViewCount")]
public IActionResult Count()
{
return Ok(new { PageViewEventHandler.Count });
}
}
================================================
FILE: samples/AspNetCoreSample/Controllers/HomeController.cs
================================================
using AspNetCoreSample.Models;
using Microsoft.AspNetCore.Mvc;
using System.Diagnostics;
namespace AspNetCoreSample.Controllers;
public class HomeController : Controller
{
public IActionResult Index()
{
return View();
}
public IActionResult About()
{
ViewData["Message"] = "Your application description page.";
return View();
}
public IActionResult Contact()
{
ViewData["Message"] = "Your contact page.";
return View();
}
public IActionResult Error()
{
return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
}
/// <summary>
/// Upload file
/// upload file in asp.net core mvc
/// https://docs.microsoft.com/en-us/aspnet/core/mvc/models/file-uploads
/// </summary>
/// <param name="formFile">fileInfo</param>
/// <returns></returns>
[HttpPost]
public string Upload(IFormFile? formFile)
{
if (formFile == null)
{
return "failed";
}
Console.WriteLine(formFile.Name);
return "success";
}
}
================================================
FILE: samples/AspNetCoreSample/Events/EventConsumer.cs
================================================
using WeihanLi.Common;
using WeihanLi.Common.Event;
using WeihanLi.Extensions;
namespace AspNetCoreSample.Events;
public class EventConsumer
(IEventQueue eventQueue, IEventHandlerFactory eventHandlerFactory)
: BackgroundService
{
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
{
while (!stoppingToken.IsCancellationRequested)
{
var queues = await eventQueue.GetQueuesAsync();
if (queues.Count > 0)
{
await queues.Select(async q =>
{
await foreach (var e in eventQueue.ReadAllAsync(q, stoppingToken))
{
var @event = e.Data;
Guard.NotNull(@event);
var handlers = eventHandlerFactory.GetHandlers(@event.GetType());
if (handlers.Count > 0)
{
await handlers
.Select(h => h.Handle(@event, e.Properties))
.WhenAll()
;
}
}
})
.WhenAll()
;
}
await Task.Delay(1000, stoppingToken);
}
}
}
================================================
FILE: samples/AspNetCoreSample/Events/PageViewEvent.cs
================================================
using WeihanLi.Common.Event;
namespace AspNetCoreSample.Events;
public class PageViewEvent
{
public string? Path { get; set; }
}
public class PageViewEventHandler : EventHandlerBase<PageViewEvent>
{
public static int Count;
public override Task Handle(PageViewEvent @event, EventProperties eventProperties)
{
Interlocked.Increment(ref Count);
return Task.CompletedTask;
}
}
================================================
FILE: samples/AspNetCoreSample/FluentAspectsServiceProviderFactory.cs
================================================
using System.Linq.Expressions;
using WeihanLi.Common.Aspect;
using WeihanLi.Extensions;
namespace AspNetCoreSample;
internal sealed class FluentAspectsServiceProviderFactory(
Action<FluentAspectOptions>? optionsAction,
Action<IFluentAspectsBuilder>? aspectBuildAction,
Expression<Func<Type, bool>>? ignoreTypesPredict
) : IServiceProviderFactory<IServiceCollection>
{
private readonly Action<FluentAspectOptions>? _optionsAction = optionsAction;
private readonly Action<IFluentAspectsBuilder>? _aspectBuildAction = aspectBuildAction;
private readonly Expression<Func<Type, bool>>? _ignoreTypesPredict = ignoreTypesPredict;
public IServiceCollection CreateBuilder(IServiceCollection services)
{
return services;
}
public IServiceProvider CreateServiceProvider(IServiceCollection containerBuilder)
{
return containerBuilder.BuildFluentAspectsProvider(_optionsAction, _aspectBuildAction, _ignoreTypesPredict);
}
}
public static class HostBuilderExtensions
{
public static IHostBuilder UseFluentAspectsServiceProviderFactory(this IHostBuilder hostBuilder,
Action<FluentAspectOptions>? optionsAction,
Action<IFluentAspectsBuilder>? aspectBuildAction = null,
Expression<Func<Type, bool>>? ignoreTypesPredict = null)
{
ignoreTypesPredict ??= t =>
t.HasNamespace() &&
(t.Namespace!.StartsWith("Microsoft.")
|| t.Namespace.StartsWith("System.")
)
;
hostBuilder.UseServiceProviderFactory(
new FluentAspectsServiceProviderFactory(optionsAction, aspectBuildAction, ignoreTypesPredict)
);
return hostBuilder;
}
}
================================================
FILE: samples/AspNetCoreSample/LogInterceptor.cs
================================================
using System.Diagnostics;
using WeihanLi.Common.Aspect;
using WeihanLi.Extensions;
namespace AspNetCoreSample;
public class EventPublishLogInterceptor : AbstractInterceptor
{
public override async Task Invoke(IInvocation invocation, Func<Task> next)
{
Console.WriteLine("-------------------------------");
Console.WriteLine($"Event publish begin, eventData:{invocation.Arguments.ToJson()}");
var watch = Stopwatch.StartNew();
try
{
await next();
}
catch (Exception ex)
{
Console.WriteLine($"Event publish exception({ex})");
}
finally
{
watch.Stop();
Console.WriteLine($"Event publish complete, elasped:{watch.ElapsedMilliseconds} ms");
}
Console.WriteLine("-------------------------------");
}
}
public class EventHandleLogInterceptor : IInterceptor
{
public async Task Invoke(IInvocation invocation, Func<Task> next)
{
Console.WriteLine("-------------------------------");
Console.WriteLine($"Event handle begin, eventData:{invocation.Arguments.ToJson()}");
var watch = Stopwatch.StartNew();
try
{
await next();
}
catch (Exception ex)
{
Console.WriteLine($"Event handle exception({ex})");
}
finally
{
watch.Stop();
Console.WriteLine($"Event handle complete, elasped:{watch.ElapsedMilliseconds} ms");
}
Console.WriteLine("-------------------------------");
}
}
================================================
FILE: samples/AspNetCoreSample/Models/ErrorViewModel.cs
================================================
namespace AspNetCoreSample.Models;
public class ErrorViewModel
{
public string? RequestId { get; set; }
public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
}
================================================
FILE: samples/AspNetCoreSample/Program.cs
================================================
using WeihanLi.Common.Aspect;
using WeihanLi.Common.Event;
namespace AspNetCoreSample;
public class Program
{
public static void Main(string[] args)
{
var host = Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(builder =>
{
builder.UseStartup<Startup>();
})
//.UseServiceProviderFactory()
.UseFluentAspectsServiceProviderFactory(options =>
{
options
.InterceptType<IEventPublisher>()
.With<EventPublishLogInterceptor>();
options.InterceptType<IEventHandler>()
.With<EventHandleLogInterceptor>();
}, builder =>
{
//builder.UseCastleProxy();
})
.Build();
//var fields = host.GetType().GetFields(BindingFlags.Instance | BindingFlags.NonPublic)
// ;
host.Run();
}
}
================================================
FILE: samples/AspNetCoreSample/Startup.cs
================================================
using AspNetCoreSample.Events;
using WeihanLi.Common;
using WeihanLi.Common.Event;
namespace AspNetCoreSample;
public class Startup(IConfiguration configuration)
{
public IConfiguration Configuration { get; } = configuration.ReplacePlaceholders();
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
services.AddControllersWithViews()
;
services.AddEvents()
.AddEventHandler<PageViewEvent, PageViewEventHandler>()
;
services.AddSingleton<IEventPublisher, EventQueuePublisher>();
services.AddHostedService<EventConsumer>();
// TestReplaceHolder
var abc = Configuration["TestSetting2:Setting2"];
Console.WriteLine(abc);
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
// Init service locator
DependencyResolver.SetDependencyResolver(app.ApplicationServices);
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
else
{
app.UseExceptionHandler("/Home/Error");
}
// pageView middleware
app.Use(async (context, next) =>
{
var eventPublisher = context.RequestServices
.GetRequiredService<IEventPublisher>();
await eventPublisher.PublishAsync(new PageViewEvent()
{
Path = context.Request.Path.Value ?? "",
});
await next();
});
app.UseHttpLogging();
app.UseRouting();
app.UseEndpoints(endpoint =>
{
endpoint.MapControllers();
endpoint.MapDefaultControllerRoute();
});
}
}
================================================
FILE: samples/AspNetCoreSample/Views/Home/About.cshtml
================================================
@{
ViewData["Title"] = "About";
}
<h2>@ViewData["Title"]</h2>
<h3>@ViewData["Message"]</h3>
<p>Use this area to provide additional information.</p>
================================================
FILE: samples/AspNetCoreSample/Views/Home/Contact.cshtml
================================================
@{
ViewData["Title"] = "Contact";
}
<h2>@ViewData["Title"]</h2>
<h3>@ViewData["Message"]</h3>
<address>
One Microsoft Way<br />
Redmond, WA 98052-6399<br />
<abbr title="Phone">P:</abbr>
425.555.0100
</address>
<address>
<strong>Support:</strong> <a href="mailto:Support@example.com">Support@example.com</a><br />
<strong>Marketing:</strong> <a href="mailto:Marketing@example.com">Marketing@example.com</a>
</address>
================================================
FILE: samples/AspNetCoreSample/Views/Home/Index.cshtml
================================================
@{
ViewData["Title"] = "Home Page";
}
<div id="myCarousel" class="carousel slide" data-ride="carousel" data-interval="6000">
<ol class="carousel-indicators">
<li data-target="#myCarousel" data-slide-to="0" class="active"></li>
<li data-target="#myCarousel" data-slide-to="1"></li>
<li data-target="#myCarousel" data-slide-to="2"></li>
<li data-target="#myCarousel" data-slide-to="3"></li>
</ol>
<div class="carousel-inner" role="listbox">
<div class="item active">
<img src="~/images/banner1.svg" alt="ASP.NET" class="img-responsive" />
<div class="carousel-caption" role="option">
<p>
Learn how to build ASP.NET apps that can run anywhere.
<a class="btn btn-default" href="https://go.microsoft.com/fwlink/?LinkID=525028&clcid=0x409">
Learn More
</a>
</p>
</div>
</div>
<div class="item">
<img src="~/images/banner2.svg" alt="Visual Studio" class="img-responsive" />
<div class="carousel-caption" role="option">
<p>
There are powerful new features in Visual Studio for building modern web apps.
<a class="btn btn-default" href="https://go.microsoft.com/fwlink/?LinkID=525030&clcid=0x409">
Learn More
</a>
</p>
</div>
</div>
<div class="item">
<img src="~/images/banner3.svg" alt="Package Management" class="img-responsive" />
<div class="carousel-caption" role="option">
<p>
Bring in libraries from NuGet and npm, and automate tasks using Grunt or Gulp.
<a class="btn btn-default" href="https://go.microsoft.com/fwlink/?LinkID=525029&clcid=0x409">
Learn More
</a>
</p>
</div>
</div>
<div class="item">
<img src="~/images/banner4.svg" alt="Microsoft Azure" class="img-responsive" />
<div class="carousel-caption" role="option">
<p>
Learn how Microsoft's Azure cloud platform allows you to build, deploy, and scale web apps.
<a class="btn btn-default" href="https://go.microsoft.com/fwlink/?LinkID=525027&clcid=0x409">
Learn More
</a>
</p>
</div>
</div>
</div>
<a class="left carousel-control" href="#myCarousel" role="button" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="right carousel-control" href="#myCarousel" role="button" data-slide="next">
<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
<div class="row">
<div class="col-md-3">
<h2>Application uses</h2>
<ul>
<li>Sample pages using ASP.NET Core MVC</li>
<li>Theming using <a href="https://go.microsoft.com/fwlink/?LinkID=398939">Bootstrap</a></li>
</ul>
</div>
<div class="col-md-3">
<h2>How to</h2>
<ul>
<li><a href="https://go.microsoft.com/fwlink/?LinkID=398600">Add a Controller and View</a></li>
<li><a href="https://go.microsoft.com/fwlink/?LinkId=699315">Manage User Secrets using Secret Manager.</a></li>
<li><a href="https://go.microsoft.com/fwlink/?LinkId=699316">Use logging to log a message.</a></li>
<li><a href="https://go.microsoft.com/fwlink/?LinkId=699317">Add packages using NuGet.</a></li>
<li><a href="https://go.microsoft.com/fwlink/?LinkId=699319">Target development, staging or production environment.</a></li>
</ul>
</div>
<div class="col-md-3">
<h2>Overview</h2>
<ul>
<li><a href="https://go.microsoft.com/fwlink/?LinkId=518008">Conceptual overview of what is ASP.NET Core</a></li>
<li><a href="https://go.microsoft.com/fwlink/?LinkId=699320">Fundamentals of ASP.NET Core such as Startup and middleware.</a></li>
<li><a href="https://go.microsoft.com/fwlink/?LinkId=398602">Working with Data</a></li>
<li><a href="https://go.microsoft.com/fwlink/?LinkId=398603">Security</a></li>
<li><a href="https://go.microsoft.com/fwlink/?LinkID=699321">Client side development</a></li>
<li><a href="https://go.microsoft.com/fwlink/?LinkID=699322">Develop on different platforms</a></li>
<li><a href="https://go.microsoft.com/fwlink/?LinkID=699323">Read more on the documentation site</a></li>
</ul>
</div>
<div class="col-md-3">
<h2>Run & Deploy</h2>
<ul>
<li><a href="https://go.microsoft.com/fwlink/?LinkID=517851">Run your app</a></li>
<li><a href="https://go.microsoft.com/fwlink/?LinkID=517853">Run tools such as EF migrations and more</a></li>
<li><a href="https://go.microsoft.com/fwlink/?LinkID=398609">Publish to Microsoft Azure Web Apps</a></li>
</ul>
</div>
</div>
================================================
FILE: samples/AspNetCoreSample/Views/Shared/Error.cshtml
================================================
@model ErrorViewModel
@{
ViewData["Title"] = "Error";
}
<h1 class="text-danger">Error.</h1>
<h2 class="text-danger">An error occurred while processing your request.</h2>
@if (Model?.ShowRequestId == true)
{
<p>
<strong>Request ID:</strong> <code>@Model.RequestId</code>
</p>
}
<h3>Development Mode</h3>
<p>
Swapping to <strong>Development</strong> environment will display more detailed information about the error that occurred.
</p>
<p>
<strong>Development environment should not be enabled in deployed applications</strong>, as it can result in sensitive information from exceptions being displayed to end users. For local debugging, development environment can be enabled by setting the <strong>ASPNETCORE_ENVIRONMENT</strong> environment variable to <strong>Development</strong>, and restarting the application.
</p>
================================================
FILE: samples/AspNetCoreSample/Views/Shared/_Layout.cshtml
================================================
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>@ViewData["Title"] - AspNetCoreSample</title>
<environment include="Development">
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.css" />
<link rel="stylesheet" href="~/css/site.css" />
</environment>
<environment exclude="Development">
<link rel="stylesheet" href="https://ajax.aspnetcdn.com/ajax/bootstrap/3.3.7/css/bootstrap.min.css"
asp-fallback-href="~/lib/bootstrap/dist/css/bootstrap.min.css"
asp-fallback-test-class="sr-only" asp-fallback-test-property="position" asp-fallback-test-value="absolute" />
<link rel="stylesheet" href="~/css/site.min.css" asp-append-version="true" />
</environment>
</head>
<body>
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a asp-area="" asp-controller="Home" asp-action="Index" class="navbar-brand">AspNetCoreSample</a>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li><a asp-area="" asp-controller="Home" asp-action="Index">Home</a></li>
<li><a asp-area="" asp-controller="Home" asp-action="About">About</a></li>
<li><a asp-area="" asp-controller="Home" asp-action="Contact">Contact</a></li>
</ul>
</div>
</div>
</nav>
<div class="container body-content">
@RenderBody()
<hr />
<footer>
<p>© 2018 - AspNetCoreSample</p>
</footer>
</div>
<environment include="Development">
<script src="~/lib/jquery/dist/jquery.js"></script>
<script src="~/lib/bootstrap/dist/js/bootstrap.js"></script>
<script src="~/js/site.js" asp-append-version="true"></script>
</environment>
<environment exclude="Development">
<script src="https://ajax.aspnetcdn.com/ajax/jquery/jquery-2.2.0.min.js"
asp-fallback-src="~/lib/jquery/dist/jquery.min.js"
asp-fallback-test="window.jQuery"
crossorigin="anonymous"
integrity="sha384-K+ctZQ+LL8q6tP7I94W+qzQsfRV2a+AfHIi9k8z8l9ggpc8X+Ytst4yBo/hH+8Fk">
</script>
<script src="https://ajax.aspnetcdn.com/ajax/bootstrap/3.3.7/bootstrap.min.js"
asp-fallback-src="~/lib/bootstrap/dist/js/bootstrap.min.js"
asp-fallback-test="window.jQuery && window.jQuery.fn && window.jQuery.fn.modal"
crossorigin="anonymous"
integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa">
</script>
<script src="~/js/site.min.js" asp-append-version="true"></script>
</environment>
@RenderSection("Scripts", required: false)
</body>
</html>
================================================
FILE: samples/AspNetCoreSample/Views/Shared/_ValidationScriptsPartial.cshtml
================================================
<environment include="Development">
<script src="~/lib/jquery-validation/dist/jquery.validate.js"></script>
<script src="~/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.js"></script>
</environment>
<environment exclude="Development">
<script src="https://ajax.aspnetcdn.com/ajax/jquery.validate/1.14.0/jquery.validate.min.js"
asp-fallback-src="~/lib/jquery-validation/dist/jquery.validate.min.js"
asp-fallback-test="window.jQuery && window.jQuery.validator"
crossorigin="anonymous"
integrity="sha384-Fnqn3nxp3506LP/7Y3j/25BlWeA3PXTyT1l78LjECcPaKCV12TsZP7yyMxOe/G/k">
</script>
<script src="https://ajax.aspnetcdn.com/ajax/jquery.validation.unobtrusive/3.2.6/jquery.validate.unobtrusive.min.js"
asp-fallback-src="~/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js"
asp-fallback-test="window.jQuery && window.jQuery.validator && window.jQuery.validator.unobtrusive"
crossorigin="anonymous"
integrity="sha384-JrXK+k53HACyavUKOsL+NkmSesD2P+73eDMrbTtTk0h4RmOF8hF8apPlkp26JlyH">
</script>
</environment>
================================================
FILE: samples/AspNetCoreSample/Views/_ViewImports.cshtml
================================================
@using AspNetCoreSample
@using AspNetCoreSample.Models
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
================================================
FILE: samples/AspNetCoreSample/Views/_ViewStart.cshtml
================================================
@{
Layout = "_Layout";
}
================================================
FILE: samples/AspNetCoreSample/appsettings.json
================================================
{
"TestSetting": {
"Setting1": "AAA"
},
"TestSetting2": {
"Setting2": "$(TestSetting:Setting1)"
},
"Logging": {
"IncludeScopes": false,
"LogLevel": {
"Default": "Warning"
}
}
}
================================================
FILE: samples/AspNetCoreSample/bundleconfig.json
================================================
// Configure bundling and minification for the project.
// More info at https://go.microsoft.com/fwlink/?LinkId=808241
[
{
"outputFileName": "wwwroot/css/site.min.css",
// An array of relative input file paths. Globbing patterns supported
"inputFiles": [
"wwwroot/css/site.css"
]
},
{
"outputFileName": "wwwroot/js/site.min.js",
"inputFiles": [
"wwwroot/js/site.js"
],
// Optionally specify minification options
"minify": {
"enabled": true,
"renameLocals": true
},
// Optionally generate .map file
"sourceMap": false
}
]
================================================
FILE: samples/AspNetCoreSample/wwwroot/css/site.css
================================================
body {
padding-top: 50px;
padding-bottom: 20px;
}
/* Wrapping element */
/* Set some basic padding to keep content from hitting the edges */
.body-content {
padding-left: 15px;
padding-right: 15px;
}
/* Carousel */
.carousel-caption p {
font-size: 20px;
line-height: 1.4;
}
/* Make .svg files in the carousel display properly in older browsers */
.carousel-inner .item img[src$=".svg"] {
width: 100%;
}
/* QR code generator */
#qrCode {
margin: 15px;
}
/* Hide/rearrange for smaller screens */
@media screen and (max-width: 767px) {
/* Hide captions */
.carousel-caption {
display: none;
}
}
================================================
FILE: samples/AspNetCoreSample/wwwroot/js/site.js
================================================
// Write your JavaScript code.
================================================
FILE: samples/AspNetCoreSample/wwwroot/lib/bootstrap/.bower.json
================================================
{
"name": "bootstrap",
"description": "The most popular front-end framework for developing responsive, mobile first projects on the web.",
"keywords": [
"css",
"js",
"less",
"mobile-first",
"responsive",
"front-end",
"framework",
"web"
],
"homepage": "http://getbootstrap.com",
"license": "MIT",
"moduleType": "globals",
"main": [
"less/bootstrap.less",
"dist/js/bootstrap.js"
],
"ignore": [
"/.*",
"_config.yml",
"CNAME",
"composer.json",
"CONTRIBUTING.md",
"docs",
"js/tests",
"test-infra"
],
"dependencies": {
"jquery": "1.9.1 - 3"
},
"version": "3.3.7",
"_release": "3.3.7",
"_resolution": {
"type": "version",
"tag": "v3.3.7",
"commit": "0b9c4a4007c44201dce9a6cc1a38407005c26c86"
},
"_source": "https://github.com/twbs/bootstrap.git",
"_target": "v3.3.7",
"_originalSource": "bootstrap",
"_direct": true
}
=========================
gitextract_2b22jhad/ ├── .config/ │ └── dotnet-tools.json ├── .copilot-instructions.md ├── .devcontainer/ │ ├── devcontainer.json │ └── scripts/ │ └── post-creation.sh ├── .editorconfig ├── .gitattributes ├── .github/ │ └── workflows/ │ ├── copilot-setup-steps.yml │ ├── default.yml │ ├── docfx.yml │ ├── dotnet-format.yml │ └── release.yml ├── .gitignore ├── .husky/ │ ├── commit-msg │ ├── post-push │ ├── pre-commit │ ├── pre-push │ ├── scripts/ │ │ └── commit-lint.cs │ └── task-runner.json ├── AGENTS.md ├── Directory.Build.props ├── Directory.Build.targets ├── Directory.Packages.props ├── LICENSE ├── README.md ├── WeihanLi.Common.sln.DotSettings ├── WeihanLi.Common.slnx ├── azure-pipelines.yml ├── build/ │ ├── exportReleaseVersion.cs │ ├── sign.props │ ├── version.props │ └── weihanli.snk ├── build.cs ├── docs/ │ ├── .gitignore │ ├── ReleaseNotes.md │ ├── api/ │ │ ├── .gitignore │ │ └── index.md │ ├── articles/ │ │ ├── intro.md │ │ └── toc.yml │ ├── docfx.json │ ├── index.md │ └── toc.yml ├── nuget.config ├── perf/ │ └── WeihanLi.Common.Benchmark/ │ ├── BenchmarkDotNet.Artifacts/ │ │ └── results/ │ │ ├── CreateInstanceTest-report-github.md │ │ ├── CreateInstanceTest-report.csv │ │ ├── CreateInstanceTest-report.html │ │ ├── DITest-report-github.md │ │ ├── DITest-report.csv │ │ ├── DITest-report.html │ │ ├── WeihanLi.Common.Benchmark.DITest-report-github.md │ │ ├── WeihanLi.Common.Benchmark.DITest-report.csv │ │ ├── WeihanLi.Common.Benchmark.DITest-report.html │ │ ├── WeihanLi.Common.Benchmark.MapperTest-report-github.md │ │ ├── WeihanLi.Common.Benchmark.MapperTest-report.csv │ │ ├── WeihanLi.Common.Benchmark.MapperTest-report.html │ │ ├── WeihanLi.Common.Benchmark.PipelineTest-report-github.md │ │ ├── WeihanLi.Common.Benchmark.PipelineTest-report.csv │ │ └── WeihanLi.Common.Benchmark.PipelineTest-report.html │ ├── DITest.cs │ ├── PipelineTest.cs │ ├── Program.cs │ └── WeihanLi.Common.Benchmark.csproj ├── samples/ │ ├── AspNetCoreSample/ │ │ ├── AspNetCoreSample.csproj │ │ ├── Controllers/ │ │ │ ├── EventsController.cs │ │ │ └── HomeController.cs │ │ ├── Events/ │ │ │ ├── EventConsumer.cs │ │ │ └── PageViewEvent.cs │ │ ├── FluentAspectsServiceProviderFactory.cs │ │ ├── LogInterceptor.cs │ │ ├── Models/ │ │ │ └── ErrorViewModel.cs │ │ ├── Program.cs │ │ ├── Startup.cs │ │ ├── Views/ │ │ │ ├── Home/ │ │ │ │ ├── About.cshtml │ │ │ │ ├── Contact.cshtml │ │ │ │ └── Index.cshtml │ │ │ ├── Shared/ │ │ │ │ ├── Error.cshtml │ │ │ │ ├── _Layout.cshtml │ │ │ │ └── _ValidationScriptsPartial.cshtml │ │ │ ├── _ViewImports.cshtml │ │ │ └── _ViewStart.cshtml │ │ ├── appsettings.json │ │ ├── bundleconfig.json │ │ └── wwwroot/ │ │ ├── css/ │ │ │ └── site.css │ │ ├── js/ │ │ │ └── site.js │ │ └── lib/ │ │ ├── bootstrap/ │ │ │ ├── .bower.json │ │ │ ├── LICENSE │ │ │ └── dist/ │ │ │ ├── css/ │ │ │ │ ├── bootstrap-theme.css │ │ │ │ └── bootstrap.css │ │ │ └── js/ │ │ │ ├── bootstrap.js │ │ │ └── npm.js │ │ ├── jquery/ │ │ │ ├── .bower.json │ │ │ ├── LICENSE.txt │ │ │ └── dist/ │ │ │ └── jquery.js │ │ ├── jquery-validation/ │ │ │ ├── .bower.json │ │ │ ├── LICENSE.md │ │ │ └── dist/ │ │ │ ├── additional-methods.js │ │ │ └── jquery.validate.js │ │ └── jquery-validation-unobtrusive/ │ │ ├── .bower.json │ │ └── jquery.validate.unobtrusive.js │ └── DotNetCoreSample/ │ ├── App.config │ ├── AppHostTest.cs │ ├── AspectTest.cs │ ├── Base64UrlEncodeTest.cs │ ├── CommandExecutorTest.cs │ ├── CronHelperTest.cs │ ├── DataExtensionTest.cs │ ├── DependencyInjectionTest.cs │ ├── DisposeTest.cs │ ├── DotNetCoreSample.csproj │ ├── EventTest.cs │ ├── GroupByEqualitySample.cs │ ├── HttpRequesterTest.cs │ ├── InMemoryStreamTest.cs │ ├── LoggerTest.cs │ ├── MapperTest.cs │ ├── NewtonJsonFormatter.cs │ ├── PagedListResultTest.cs │ ├── PipelineTest.cs │ ├── ProcessExecutorTest.cs │ ├── Program.cs │ ├── RepositoryTest.cs │ ├── RequestHelperTest.cs │ ├── SerilogTest.cs │ ├── ServiceDecoratorTest.cs │ ├── TaskTest.cs │ ├── TemplatingSample.cs │ ├── Test/ │ │ └── PagedListModel1.cs │ ├── TotpTest.cs │ └── appsettings.json ├── src/ │ ├── Directory.Build.props │ ├── WeihanLi.Common/ │ │ ├── Abstractions/ │ │ │ └── Properties.cs │ │ ├── Aspect/ │ │ │ ├── AspectDelegate.cs │ │ │ ├── AspectInvokeException.cs │ │ │ ├── AttributeInterceptorResolver.cs │ │ │ ├── DefaultProxyFactory.cs │ │ │ ├── DefaultProxyTypeFactory.cs │ │ │ ├── DelegateInterceptor.cs │ │ │ ├── FluentAspectOptions.cs │ │ │ ├── FluentAspectOptionsExtensions.cs │ │ │ ├── FluentAspects.cs │ │ │ ├── FluentAspectsBuilder.cs │ │ │ ├── FluentAspectsServiceContainerBuilder.cs │ │ │ ├── FluentConfigInterceptorResolver.cs │ │ │ ├── IInterceptionConfiguration.cs │ │ │ ├── IInterceptor.cs │ │ │ ├── IInterceptorResolver.cs │ │ │ ├── IInvocation.cs │ │ │ ├── IProxyFactory.cs │ │ │ ├── IProxyTypeFactory.cs │ │ │ ├── InternalAspectHelper.cs │ │ │ ├── InvocationEnricher.cs │ │ │ ├── InvocationEnricherExtensions.cs │ │ │ ├── MethodSignature.cs │ │ │ ├── ProxyFactoryExtensions.cs │ │ │ ├── ProxyUtils.cs │ │ │ ├── ServiceCollectionExtensions.cs │ │ │ └── ServiceContainerBuilderExtensions.cs │ │ ├── CacheUtil.cs │ │ ├── Compressor/ │ │ │ └── DataCompressor.cs │ │ ├── Data/ │ │ │ ├── Expressions/ │ │ │ │ ├── DateTimeExpressionParser.cs │ │ │ │ └── StringExpressionParser.cs │ │ │ ├── IRepository.cs │ │ │ ├── IUnitOfWork.cs │ │ │ ├── Repository.cs │ │ │ ├── RepositoryExtension.cs │ │ │ ├── SqlExpressionParser.cs │ │ │ ├── SqlExpressionVisitor.cs │ │ │ └── UnitOfWork.cs │ │ ├── DependencyInjection/ │ │ │ ├── DependencyInjectionExtensions.cs │ │ │ ├── FromServiceAttribute.cs │ │ │ ├── ServiceConstructorAttribute.cs │ │ │ ├── ServiceContainer.cs │ │ │ ├── ServiceContainerBuilder.cs │ │ │ ├── ServiceContainerBuilderExtensions.cs │ │ │ ├── ServiceContainerBuilderExtensions.generated.cs │ │ │ ├── ServiceContainerBuilderExtensions.tt │ │ │ ├── ServiceContainerModule.cs │ │ │ ├── ServiceDefinition.cs │ │ │ └── ServiceLifetime.cs │ │ ├── DependencyResolver.cs │ │ ├── Event/ │ │ │ ├── AckQueue.cs │ │ │ ├── DelegateEventHandler.cs │ │ │ ├── EventBase.cs │ │ │ ├── EventBus.cs │ │ │ ├── EventBusExtensions.cs │ │ │ ├── EventHandler.cs │ │ │ ├── EventHandlerFactory.cs │ │ │ ├── EventProperties.cs │ │ │ ├── EventQueueInMemory.cs │ │ │ ├── EventQueuePublisher.cs │ │ │ ├── EventStoreInMemory.cs │ │ │ ├── EventSubscriptionManager.cs │ │ │ ├── IEventBus.cs │ │ │ ├── IEventHandlerFactory.cs │ │ │ ├── IEventPublisher.cs │ │ │ ├── IEventQueue.cs │ │ │ ├── IEventStore.cs │ │ │ └── IEventSubscriber.cs │ │ ├── Extensions/ │ │ │ ├── CollectionExtension.cs │ │ │ ├── CompressionExtension.cs │ │ │ ├── ConfigurationExtension.cs │ │ │ ├── CoreExtension.cs │ │ │ ├── CronExtension.cs │ │ │ ├── DataExtension.cs │ │ │ ├── DbCommandExtension.generated.cs │ │ │ ├── DbCommandExtension.tt │ │ │ ├── DbConnectionExtension.generated.cs │ │ │ ├── DbConnectionExtension.tt │ │ │ ├── DictionaryExtension.cs │ │ │ ├── DumpExtension.cs │ │ │ ├── EnumerableExtension.cs │ │ │ ├── ExceptionExtension.cs │ │ │ ├── ExpressionExtension.cs │ │ │ ├── FuncExtension.cs │ │ │ ├── HttpClientExtension.cs │ │ │ ├── HttpRequesterExtension.cs │ │ │ ├── ILGeneratorExtensions.cs │ │ │ ├── IOExtension.cs │ │ │ ├── JsonSerializeExtension.cs │ │ │ ├── NetExtension.cs │ │ │ ├── ProcessExtension.cs │ │ │ ├── PropertiesExtensions.cs │ │ │ ├── QueryableExtension.cs │ │ │ ├── ReflectionExtension.cs │ │ │ ├── ServiceCollectionExtension.cs │ │ │ ├── StringExtension.cs │ │ │ ├── TaskExtension.cs │ │ │ └── TypeExtension.cs │ │ ├── Guard.cs │ │ ├── Helpers/ │ │ │ ├── ActivatorHelper.cs │ │ │ ├── ApplicationHelper.cs │ │ │ ├── ArrayHelper.cs │ │ │ ├── AsyncLock.cs │ │ │ ├── Base32EncodeHelper.cs │ │ │ ├── Base64UrlEncodeHelper.cs │ │ │ ├── BoundedConcurrentQueue.cs │ │ │ ├── BuildProcess.cs │ │ │ ├── Combinatorics/ │ │ │ │ ├── Combinations.cs │ │ │ │ ├── GenerateOption.cs │ │ │ │ ├── Permutations.cs │ │ │ │ ├── SmallPrimeUtility.cs │ │ │ │ └── Variations.cs │ │ │ ├── CommandExecutor.cs │ │ │ ├── CommandLineParser.cs │ │ │ ├── ConcurrentSet.cs │ │ │ ├── ConsoleHelper.cs │ │ │ ├── ConsoleOutput.cs │ │ │ ├── ContextAccessor.cs │ │ │ ├── ConvertHelper.cs │ │ │ ├── Cron/ │ │ │ │ ├── CalendarHelper.cs │ │ │ │ ├── CronExpression.cs │ │ │ │ ├── CronExpressionFlag.cs │ │ │ │ ├── CronField.cs │ │ │ │ ├── CronFormat.cs │ │ │ │ ├── CronFormatException.cs │ │ │ │ └── TimeZoneHelper.cs │ │ │ ├── CronHelper.cs │ │ │ ├── DataSerializer.cs │ │ │ ├── DelegateHelper.cs │ │ │ ├── DelegateTextWriter.cs │ │ │ ├── DiagnosticHelper.cs │ │ │ ├── DisposableHelper.cs │ │ │ ├── Encoder.cs │ │ │ ├── Enricher.cs │ │ │ ├── EnumHelper.cs │ │ │ ├── EnvHelper.cs │ │ │ ├── ExpressionHelper.cs │ │ │ ├── HashHelper.cs │ │ │ ├── Hosting/ │ │ │ │ ├── AppHost.cs │ │ │ │ ├── AppHostBuilder.cs │ │ │ │ ├── AppHostBuilderExtensions.cs │ │ │ │ ├── AppHostBuilderSettings.cs │ │ │ │ ├── AppHostOptions.cs │ │ │ │ ├── BackgroundService.cs │ │ │ │ ├── CronBasedBackgroundService.cs │ │ │ │ ├── IHostedService.cs │ │ │ │ └── TimerBaseBackgroundService.cs │ │ │ ├── HttpHelper.cs │ │ │ ├── InMemoryStream.cs │ │ │ ├── InterlockedHelper.cs │ │ │ ├── InteropHelper.cs │ │ │ ├── InvokeHelper.cs │ │ │ ├── JsonHelper.cs │ │ │ ├── LogHelper.cs │ │ │ ├── MapHelper.cs │ │ │ ├── NetHelper.cs │ │ │ ├── NewFuncHelper.cs │ │ │ ├── PeriodBatching/ │ │ │ │ ├── BatchedConnectionStatus.cs │ │ │ │ ├── PeriodicBatching.cs │ │ │ │ └── PortableTimer.cs │ │ │ ├── PipelineBuilder.cs │ │ │ ├── Pipelines/ │ │ │ │ ├── AsyncPipelineBuilder.cs │ │ │ │ ├── PipelineBuilder.cs │ │ │ │ ├── PipelineBuilderExtensions.cs │ │ │ │ ├── PipelineMiddleware.cs │ │ │ │ └── ValueAsyncPipelineBuilder.cs │ │ │ ├── ProcessExecutor.cs │ │ │ ├── ProfilerHelper.cs │ │ │ ├── ReflectHelper.cs │ │ │ ├── RequestHelper.cs │ │ │ ├── RetryHelper.cs │ │ │ ├── SecurityHelper.cs │ │ │ ├── SequentialGuidGenerator.cs │ │ │ ├── StringHelper.cs │ │ │ ├── TaskHelper.cs │ │ │ ├── TotpHelper.cs │ │ │ ├── TypeHelper.cs │ │ │ ├── ValidateHelper.cs │ │ │ └── ValueStopwatch.cs │ │ ├── Http/ │ │ │ ├── HttpHeaderNames.cs │ │ │ ├── HttpRequester.cs │ │ │ ├── IHttpRequester.cs │ │ │ ├── JsonHttpContent.cs │ │ │ ├── MockHttpHandler.cs │ │ │ └── NoProxyHttpClientHandler.cs │ │ ├── IDependencyResolver.cs │ │ ├── Json/ │ │ │ ├── DateTimeFormatConverter.cs │ │ │ └── IPAddressConverter.cs │ │ ├── Logging/ │ │ │ ├── ConsoleLoggingProvider.cs │ │ │ ├── FileLoggingProcessor.cs │ │ │ ├── LogHelperExtensions.cs │ │ │ ├── LogHelperFactory.cs │ │ │ ├── LogHelperLogLevel.cs │ │ │ ├── LogHelperLogger.cs │ │ │ ├── LogHelperLoggingEvent.cs │ │ │ ├── LogHelperProvider.cs │ │ │ ├── LoggerGeneric.cs │ │ │ ├── LoggingBuilder.cs │ │ │ ├── LoggingEnricher.cs │ │ │ ├── LoggingFormatter.cs │ │ │ ├── MicrosoftLoggingLogHelperProvider.cs │ │ │ ├── MicrosoftLoggingLoggerExtensions.cs │ │ │ └── PeriodBatchingLoggingService.cs │ │ ├── Models/ │ │ │ ├── BaseEntity.cs │ │ │ ├── Category.cs │ │ │ ├── DataOperationType.cs │ │ │ ├── IdNameModel.cs │ │ │ ├── KeyEntry.cs │ │ │ ├── ModelValidator.cs │ │ │ ├── Ordering.cs │ │ │ ├── PagedListResult.cs │ │ │ ├── PagedRequest.cs │ │ │ ├── Result.cs │ │ │ ├── ResultStatus.cs │ │ │ ├── ReviewState.cs │ │ │ ├── SoftDeleteEntity.cs │ │ │ ├── StringValueDictionary.cs │ │ │ ├── TenantInfo.cs │ │ │ └── ValidationResult.cs │ │ ├── Otp/ │ │ │ ├── OtpHashAlgorithm.cs │ │ │ ├── Totp.cs │ │ │ └── TotpOptions.cs │ │ ├── Polyfill/ │ │ │ └── TaskCompletionSource.cs │ │ ├── README.md │ │ ├── Resource.Designer.cs │ │ ├── Resource.resx │ │ ├── Services/ │ │ │ ├── CancellationTokenProvider.cs │ │ │ ├── IProfiler.cs │ │ │ ├── IScope.cs │ │ │ ├── ITenantProvider.cs │ │ │ ├── IdGenerator.cs │ │ │ ├── TotpService.cs │ │ │ ├── UserIdProvider.cs │ │ │ ├── Validator.cs │ │ │ └── Wrapper.cs │ │ ├── Template/ │ │ │ ├── ConfigurationRenderMiddleare.cs │ │ │ ├── DefaultRenderMiddleware.cs │ │ │ ├── DefaultTemplateParser.cs │ │ │ ├── DefaultTemplateRenderer.cs │ │ │ ├── DependencyInjectionExtensions.cs │ │ │ ├── EnvRenderMiddleware.cs │ │ │ ├── IRenderMiddleware.cs │ │ │ ├── ITemplateEngine.cs │ │ │ ├── ITemplateParser.cs │ │ │ ├── ITemplatePipe.cs │ │ │ ├── ITemplateRenderer.cs │ │ │ ├── ITemplateRendererBuilder.cs │ │ │ ├── TemplateEngine.cs │ │ │ ├── TemplateEngineOptions.cs │ │ │ ├── TemplateEngineServiceBuilder.cs │ │ │ ├── TemplatePipes.cs │ │ │ ├── TemplateRenderContext.cs │ │ │ └── TemplateRendererBuilder.cs │ │ └── WeihanLi.Common.csproj │ ├── WeihanLi.Common.Logging.Serilog/ │ │ ├── README.md │ │ ├── SerilogHelper.cs │ │ ├── SerilogLogHelperProvider.cs │ │ ├── SerilogLogger.cs │ │ ├── SerilogLoggerExtensions.cs │ │ ├── SerilogLoggerProvider.cs │ │ ├── SerilogLoggerScope.cs │ │ └── WeihanLi.Common.Logging.Serilog.csproj │ └── WeihanLi.Extensions.Hosting/ │ ├── CronBasedBackgroundService.cs │ ├── HostingExtensions.cs │ ├── README.md │ ├── TimerBaseBackgroundService.cs │ └── WeihanLi.Extensions.Hosting.csproj ├── test/ │ └── WeihanLi.Common.Test/ │ ├── AspectTest/ │ │ ├── ProxyFactoryTest.cs │ │ ├── ServiceCollectionBuildTest.cs │ │ ├── ServiceContainerBuilderBuildTest.cs │ │ └── TestOutputInterceptor.cs │ ├── AsyncLockTest.cs │ ├── CacheUtilTest.cs │ ├── CompressorTest/ │ │ └── DataCompressorTest.cs │ ├── DependencyInjectionTest.cs │ ├── DisposalTest.cs │ ├── EventsTest/ │ │ ├── AckQueueTest.cs │ │ ├── EventBaseTest.cs │ │ └── EventBusTest.cs │ ├── ExtensionsTest/ │ │ ├── CollectionExtensionTest.cs │ │ ├── CompressExtensionTest.cs │ │ ├── ConfigurationExtensionTest.cs │ │ ├── CoreExtensionTest.cs │ │ ├── EnumerableExtensionTest.cs │ │ ├── ServiceCollectionExtensionTest.cs │ │ ├── StringExtensionTest.cs │ │ ├── TaskExtensionsTest.cs │ │ └── TypeExtensionTest.cs │ ├── HelpersTest/ │ │ ├── ApplicationHelperTest.cs │ │ ├── BoundedConcurrentQueue.cs │ │ ├── CommandExecutorTest.cs │ │ ├── ConsoleHelperTest.cs │ │ ├── EncoderTest.cs │ │ ├── EnumHelperTest.cs │ │ ├── NetHelperTest.cs │ │ ├── ProcessExecutorTest.cs │ │ ├── SecurityHelperTest.cs │ │ ├── StringHelperTest.cs │ │ ├── TotpHelperTest.cs │ │ └── ValidateHelperTest.cs │ ├── HttpTest/ │ │ └── MockHttpHandlerTest.cs │ ├── IdGeneratorTest.cs │ ├── JsonTest/ │ │ └── JsonConvertTest.cs │ ├── ModelsTest/ │ │ ├── PagedListDataTest.cs │ │ ├── PagedRequestTest.cs │ │ ├── ResultTest.cs │ │ ├── ReviewModelTest.cs │ │ └── StringValueDictionaryTest.cs │ ├── ProfilerTest.cs │ ├── ServicesTest/ │ │ ├── CancellationTokenProviderTest.cs │ │ ├── TotpServiceTest.cs │ │ └── UserIdProviderTest.cs │ ├── TemplateTest/ │ │ ├── TemplateParserTest.cs │ │ └── TemplateRendererTest.cs │ └── WeihanLi.Common.Test.csproj └── toc.yml
Showing preview only (321K chars total). Download the full file or copy to clipboard to get everything.
SYMBOL INDEX (3182 symbols across 348 files)
FILE: perf/WeihanLi.Common.Benchmark/DITest.cs
class DITest (line 13) | [Config(typeof(CoreConfig))]
class CoreConfig (line 17) | private class CoreConfig : ManualConfig
method CoreConfig (line 19) | public CoreConfig()
method Setup (line 38) | [GlobalSetup]
method Cleanup (line 82) | [GlobalCleanup]
method NoDI (line 91) | [Benchmark(Baseline = true, OperationsPerInvoke = OperationsPerInvoke)]
method Singleton (line 114) | [Benchmark(OperationsPerInvoke = OperationsPerInvoke)]
method Transient (line 134) | [Benchmark(OperationsPerInvoke = OperationsPerInvoke)]
method ServiceContainerSingletonTest (line 144) | [Benchmark(OperationsPerInvoke = OperationsPerInvoke)]
method ServiceContainerTransientTest (line 164) | [Benchmark(OperationsPerInvoke = OperationsPerInvoke)]
class A (line 174) | private class A
method A (line 176) | public A(B b)
method Foo (line 180) | [MethodImpl(MethodImplOptions.NoInlining)]
class B (line 186) | private class B
method B (line 188) | public B(C c)
class C (line 193) | private class C
FILE: perf/WeihanLi.Common.Benchmark/PipelineTest.cs
class PipelineTest (line 10) | [MemoryDiagnoser]
class TestContext (line 13) | private sealed class TestContext
method ValueTaskPipeline (line 17) | [Benchmark]
method ValueTaskPipelineInvoke (line 35) | [Benchmark]
method TaskPipeline (line 62) | [Benchmark]
method TaskPipelineInvoke (line 81) | [Benchmark]
FILE: perf/WeihanLi.Common.Benchmark/Program.cs
class Program (line 5) | public class Program
method Main (line 7) | public static void Main(string[] args)
FILE: samples/AspNetCoreSample/Controllers/EventsController.cs
class EventsController (line 6) | [Route("api/[controller]")]
method Count (line 9) | [HttpGet("pageViewCount")]
FILE: samples/AspNetCoreSample/Controllers/HomeController.cs
class HomeController (line 7) | public class HomeController : Controller
method Index (line 9) | public IActionResult Index()
method About (line 14) | public IActionResult About()
method Contact (line 21) | public IActionResult Contact()
method Error (line 28) | public IActionResult Error()
method Upload (line 40) | [HttpPost]
FILE: samples/AspNetCoreSample/Events/EventConsumer.cs
class EventConsumer (line 7) | public class EventConsumer
method ExecuteAsync (line 11) | protected override async Task ExecuteAsync(CancellationToken stoppingT...
FILE: samples/AspNetCoreSample/Events/PageViewEvent.cs
class PageViewEvent (line 5) | public class PageViewEvent
class PageViewEventHandler (line 10) | public class PageViewEventHandler : EventHandlerBase<PageViewEvent>
method Handle (line 14) | public override Task Handle(PageViewEvent @event, EventProperties even...
FILE: samples/AspNetCoreSample/FluentAspectsServiceProviderFactory.cs
class FluentAspectsServiceProviderFactory (line 7) | internal sealed class FluentAspectsServiceProviderFactory(
method CreateBuilder (line 17) | public IServiceCollection CreateBuilder(IServiceCollection services)
method CreateServiceProvider (line 22) | public IServiceProvider CreateServiceProvider(IServiceCollection conta...
class HostBuilderExtensions (line 28) | public static class HostBuilderExtensions
method UseFluentAspectsServiceProviderFactory (line 30) | public static IHostBuilder UseFluentAspectsServiceProviderFactory(this...
FILE: samples/AspNetCoreSample/LogInterceptor.cs
class EventPublishLogInterceptor (line 7) | public class EventPublishLogInterceptor : AbstractInterceptor
method Invoke (line 9) | public override async Task Invoke(IInvocation invocation, Func<Task> n...
class EventHandleLogInterceptor (line 31) | public class EventHandleLogInterceptor : IInterceptor
method Invoke (line 33) | public async Task Invoke(IInvocation invocation, Func<Task> next)
FILE: samples/AspNetCoreSample/Models/ErrorViewModel.cs
class ErrorViewModel (line 3) | public class ErrorViewModel
FILE: samples/AspNetCoreSample/Program.cs
class Program (line 6) | public class Program
method Main (line 8) | public static void Main(string[] args)
FILE: samples/AspNetCoreSample/Startup.cs
class Startup (line 7) | public class Startup(IConfiguration configuration)
method ConfigureServices (line 12) | public void ConfigureServices(IServiceCollection services)
method Configure (line 30) | public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
FILE: samples/AspNetCoreSample/wwwroot/lib/bootstrap/dist/js/bootstrap.js
function transitionEnd (line 34) | function transitionEnd() {
function removeElement (line 126) | function removeElement() {
function Plugin (line 142) | function Plugin(option) {
function Plugin (line 251) | function Plugin(option) {
function Plugin (line 475) | function Plugin(option) {
function getTargetFromTrigger (line 695) | function getTargetFromTrigger($trigger) {
function Plugin (line 707) | function Plugin(option) {
function getParent (line 774) | function getParent($this) {
function clearMenus (line 787) | function clearMenus(e) {
function Plugin (line 880) | function Plugin(option) {
function Plugin (line 1208) | function Plugin(option, _relatedTarget) {
function complete (line 1574) | function complete() {
function Plugin (line 1750) | function Plugin(option) {
function Plugin (line 1859) | function Plugin(option) {
function ScrollSpy (line 1902) | function ScrollSpy(element, options) {
function Plugin (line 2022) | function Plugin(option) {
function next (line 2131) | function next() {
function Plugin (line 2177) | function Plugin(option) {
function Plugin (line 2334) | function Plugin(option) {
FILE: samples/AspNetCoreSample/wwwroot/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.js
function setValidationValues (line 14) | function setValidationValues(options, ruleName, value) {
function splitAndTrim (line 21) | function splitAndTrim(value) {
function escapeAttributeValue (line 25) | function escapeAttributeValue(value) {
function getModelPrefix (line 30) | function getModelPrefix(fieldName) {
function appendModelPrefix (line 34) | function appendModelPrefix(value, prefix) {
function onError (line 41) | function onError(error, inputElement) { // 'this' is the form element
function onErrors (line 58) | function onErrors(event, validator) { // 'this' is the form element
function onSuccess (line 72) | function onSuccess(error) { // 'this' is the form element
function onReset (line 88) | function onReset(event) { // 'this' is the form element
function validationInfo (line 113) | function validationInfo(form) {
FILE: samples/AspNetCoreSample/wwwroot/lib/jquery-validation/dist/additional-methods.js
function stripHtml (line 19) | function stripHtml(value) {
FILE: samples/AspNetCoreSample/wwwroot/lib/jquery-validation/dist/jquery.validate.js
function handle (line 65) | function handle() {
function delegate (line 375) | function delegate( event ) {
FILE: samples/AspNetCoreSample/wwwroot/lib/jquery/dist/jquery.js
function isArrayLike (line 524) | function isArrayLike( obj ) {
function Sizzle (line 733) | function Sizzle( selector, context, results, seed ) {
function createCache (line 873) | function createCache() {
function markFunction (line 891) | function markFunction( fn ) {
function assert (line 900) | function assert( fn ) {
function addHandle (line 922) | function addHandle( attrs, handler ) {
function siblingCheck (line 937) | function siblingCheck( a, b ) {
function createInputPseudo (line 964) | function createInputPseudo( type ) {
function createButtonPseudo (line 975) | function createButtonPseudo( type ) {
function createPositionalPseudo (line 986) | function createPositionalPseudo( fn ) {
function testContext (line 1009) | function testContext( context ) {
function setFilters (line 2054) | function setFilters() {}
function toSelector (line 2125) | function toSelector( tokens ) {
function addCombinator (line 2135) | function addCombinator( matcher, combinator, base ) {
function elementMatcher (line 2193) | function elementMatcher( matchers ) {
function multipleContexts (line 2207) | function multipleContexts( selector, contexts, results ) {
function condense (line 2216) | function condense( unmatched, map, filter, context, xml ) {
function setMatcher (line 2237) | function setMatcher( preFilter, selector, matcher, postFilter, postFinde...
function matcherFromTokens (line 2330) | function matcherFromTokens( tokens ) {
function matcherFromGroupMatchers (line 2388) | function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
function winnow (line 2726) | function winnow( elements, qualifier, not ) {
function sibling (line 3033) | function sibling( cur, dir ) {
function createOptions (line 3109) | function createOptions( options ) {
function completed (line 3544) | function completed() {
function Data (line 3655) | function Data() {
function dataAttr (line 3865) | function dataAttr( elem, key, data ) {
function adjustCSS (line 4182) | function adjustCSS( elem, prop, valueParts, tween ) {
function getAll (line 4271) | function getAll( context, tag ) {
function setGlobalEval (line 4288) | function setGlobalEval( elems, refElements ) {
function buildFragment (line 4304) | function buildFragment( elems, context, scripts, selection, ignored ) {
function returnTrue (line 4425) | function returnTrue() {
function returnFalse (line 4429) | function returnFalse() {
function safeActiveElement (line 4435) | function safeActiveElement() {
function on (line 4441) | function on( elem, types, selector, data, fn, one ) {
function manipulationTarget (line 5131) | function manipulationTarget( elem, content ) {
function disableScript (line 5142) | function disableScript( elem ) {
function restoreScript (line 5146) | function restoreScript( elem ) {
function cloneCopyEvent (line 5158) | function cloneCopyEvent( src, dest ) {
function fixInput (line 5193) | function fixInput( src, dest ) {
function domManip (line 5206) | function domManip( collection, args, callback, ignored ) {
function remove (line 5296) | function remove( elem, selector, keepData ) {
function actualDisplay (line 5587) | function actualDisplay( name, doc ) {
function defaultDisplay (line 5603) | function defaultDisplay( nodeName ) {
function computeStyleTests (line 5699) | function computeStyleTests() {
function curCSS (line 5789) | function curCSS( elem, name, computed ) {
function addGetHookIf (line 5836) | function addGetHookIf( conditionFn, hookFn ) {
function vendorPropName (line 5873) | function vendorPropName( name ) {
function setPositiveNumber (line 5892) | function setPositiveNumber( elem, value, subtract ) {
function augmentWidthOrHeight (line 5904) | function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {
function getWidthOrHeight (line 5948) | function getWidthOrHeight( elem, name, extra ) {
function showHide (line 6006) | function showHide( elements, show ) {
function Tween (line 6345) | function Tween( elem, options, prop, end, easing ) {
function createFxNow (line 6469) | function createFxNow() {
function genFx (line 6477) | function genFx( type, includeWidth ) {
function createTween (line 6497) | function createTween( value, prop, animation ) {
function defaultPrefilter (line 6511) | function defaultPrefilter( elem, props, opts ) {
function propFilter (line 6647) | function propFilter( props, specialEasing ) {
function Animation (line 6684) | function Animation( elem, properties, options ) {
function getClass (line 7357) | function getClass( elem ) {
function addToPrefiltersOrTransports (line 8022) | function addToPrefiltersOrTransports( structure ) {
function inspectPrefiltersOrTransports (line 8056) | function inspectPrefiltersOrTransports( structure, options, originalOpti...
function ajaxExtend (line 8085) | function ajaxExtend( target, src ) {
function ajaxHandleResponses (line 8105) | function ajaxHandleResponses( s, jqXHR, responses ) {
function ajaxConvert (line 8163) | function ajaxConvert( s, response, jqXHR, isSuccess ) {
function done (line 8668) | function done( status, nativeStatusText, responses, headers ) {
function buildParams (line 8921) | function buildParams( prefix, obj, traditional, add ) {
function getWindow (line 9504) | function getWindow( elem ) {
FILE: samples/DotNetCoreSample/AppHostTest.cs
class AppHostTest (line 16) | public static class AppHostTest
method MainTest (line 18) | public static async Task MainTest()
class TimerService (line 37) | file sealed class TimerService : TimerBaseBackgroundService
method ExecuteTaskAsync (line 41) | protected override Task ExecuteTaskAsync(CancellationToken stoppingToken)
class DiagnosticBackgroundService (line 48) | file sealed class DiagnosticBackgroundService(IServiceProvider servicePr...
method ExecuteTaskInternalAsync (line 52) | protected override Task ExecuteTaskInternalAsync(IServiceProvider serv...
class LoggingBuilderExtensions (line 59) | public static partial class LoggingBuilderExtensions
method AddRelaxedJsonConsole (line 61) | public static ILoggingBuilder AddRelaxedJsonConsole(this ILoggingBuild...
type IWebServer (line 75) | file interface IWebServer
method StartAsync (line 77) | Task StartAsync(CancellationToken cancellationToken);
method StopAsync (line 79) | Task StopAsync(CancellationToken cancellationToken);
class HttpListenerWebServer (line 82) | file sealed class HttpListenerWebServer(IServiceProvider serviceProvider...
method StartAsync (line 87) | public async Task StartAsync(CancellationToken cancellationToken)
method StopAsync (line 114) | public Task StopAsync(CancellationToken cancellationToken)
class WebServerHostedService (line 121) | file sealed class WebServerHostedService(IWebServer server) : Background...
method StopAsync (line 125) | public override async Task StopAsync(CancellationToken cancellationToken)
method ExecuteAsync (line 131) | protected override async Task ExecuteAsync(CancellationToken stoppingT...
FILE: samples/DotNetCoreSample/AspectTest.cs
class TestDbContext (line 9) | public class TestDbContext(DbContextOptions<TestDbContext> dbContextOpti...
method OnConfiguring (line 11) | protected override void OnConfiguring(DbContextOptionsBuilder optionsB...
class DbContextSaveInterceptor (line 20) | internal class DbContextSaveInterceptor : IInterceptor
method Invoke (line 22) | public async Task Invoke(IInvocation invocation, Func<Task> next)
class AspectTest (line 50) | internal class AspectTest
method ServiceContainerTest (line 52) | public static void ServiceContainerTest()
FILE: samples/DotNetCoreSample/Base64UrlEncodeTest.cs
class Base64UrlEncodeTest (line 5) | public class Base64UrlEncodeTest
method MainTest (line 9) | public static void MainTest()
FILE: samples/DotNetCoreSample/CommandExecutorTest.cs
class CommandExecutorTest (line 10) | internal static class CommandExecutorTest
method MainTest (line 12) | public static void MainTest()
FILE: samples/DotNetCoreSample/CronHelperTest.cs
class CronHelperTest (line 6) | public static class CronHelperTest
method MainTest (line 8) | public static void MainTest()
FILE: samples/DotNetCoreSample/DataExtensionTest.cs
class DataExtensionTest (line 12) | public class DataExtensionTest
method Init (line 19) | private static void Init(DbConnection conn)
method MainTest (line 36) | public static void MainTest()
method Clean (line 120) | private static void Clean(DbConnection conn)
class TestEntity (line 126) | [Table("tabTestEntity")]
FILE: samples/DotNetCoreSample/DependencyInjectionTest.cs
class DependencyInjectionTest (line 13) | internal class DependencyInjectionTest
method Test (line 17) | public static void Test()
method BuiltInIocTest (line 30) | public static void BuiltInIocTest()
class WuKong (line 130) | private class WuKong : IDisposable
method WuKong (line 132) | public WuKong()
method Jump (line 137) | public void Jump()
method Dispose (line 142) | public void Dispose()
class WuJing (line 148) | private class WuJing : IDisposable
method WuJing (line 150) | public WuJing()
method Eat (line 155) | public void Eat()
method Dispose (line 160) | public void Dispose()
class GenericServiceTest (line 166) | private class GenericServiceTest<T>
method Test (line 168) | public void Test()
class HasDependencyTest (line 174) | private class HasDependencyTest
method HasDependencyTest (line 178) | public HasDependencyTest(IFly fly)
method Test (line 183) | public void Test()
class HasDependencyTest1 (line 190) | private class HasDependencyTest1
method HasDependencyTest1 (line 194) | public HasDependencyTest1(IEnumerable<IFly> flys)
method Test (line 199) | public void Test()
class HasDependencyTest2 (line 209) | private class HasDependencyTest2
method HasDependencyTest2 (line 213) | public HasDependencyTest2(IReadOnlyCollection<IFly> flys)
method Test (line 218) | public void Test()
class HasDependencyTest3 (line 228) | private class HasDependencyTest3
method HasDependencyTest3 (line 232) | public HasDependencyTest3(IEnumerable<GenericServiceTest<int>> svcs)
method Test (line 237) | public void Test()
class HasDependencyTest4 (line 247) | private class HasDependencyTest4<T>
method HasDependencyTest4 (line 251) | public HasDependencyTest4(IEnumerable<GenericServiceTest<T>> svcs)
method Test (line 256) | public void Test()
type IFly (line 267) | public interface IFly
method Fly (line 271) | void Fly();
method OpenFly (line 273) | void OpenFly<T>();
method FlyAway (line 275) | string FlyAway();
type IAnimal (line 278) | public interface IAnimal<T>
method Eat (line 280) | void Eat();
class Animal (line 283) | public class Animal<T>
method Eat (line 288) | public virtual void Eat()
method GetEatCount (line 294) | public int GetEatCount() => _eatCounter;
method Drink (line 296) | public virtual void Drink(T t)
method GetDrinkCount (line 302) | public virtual int GetDrinkCount() => _drinkCounter;
class LogInterceptor (line 305) | public class LogInterceptor : AbstractInterceptor
method Invoke (line 307) | public override async Task Invoke(IInvocation invocation, Func<Task> n...
class MonkeyKing (line 326) | public class MonkeyKing : IFly, IDisposable
method Fly (line 330) | public void Fly()
method OpenFly (line 335) | public void OpenFly<T>()
method FlyAway (line 340) | public string FlyAway() => "十万八千里";
method Dispose (line 342) | public void Dispose()
class Superman (line 348) | internal class Superman : IFly
method Fly (line 352) | public void Fly()
method OpenFly (line 357) | public void OpenFly<T>()
method FlyAway (line 362) | public string FlyAway() => "xxxxx";
class TestServiceContainerModule (line 365) | internal class TestServiceContainerModule : ServiceContainerModule
method ConfigureServices (line 367) | public override void ConfigureServices(IServiceContainerBuilder servic...
FILE: samples/DotNetCoreSample/DisposeTest.cs
class DisposeTest (line 8) | public class DisposeTest
method MainTest (line 10) | public static void MainTest()
method MainTestAsync (line 43) | public static async ValueTask MainTestAsync()
class TestService (line 77) | file sealed class TestService : DisposableBase
method Dispose (line 81) | protected override void Dispose(bool disposing)
method DisposeAsyncCore (line 91) | protected override async ValueTask DisposeAsyncCore()
FILE: samples/DotNetCoreSample/EventTest.cs
class EventTest (line 11) | internal class EventTest
method MainTest (line 13) | public static async Task MainTest()
method AckQueueTest (line 52) | public static async Task AckQueueTest()
class CounterEvent (line 83) | public class CounterEvent
class CounterEventHandler1 (line 88) | internal class CounterEventHandler1 : EventHandlerBase<CounterEvent>
method Handle (line 90) | public override Task Handle(CounterEvent @event, EventProperties event...
class CounterEventHandler2 (line 97) | internal class CounterEventHandler2 : EventHandlerBase<CounterEvent>
method Handle (line 99) | public override Task Handle(CounterEvent @event, EventProperties event...
FILE: samples/DotNetCoreSample/GroupByEqualitySample.cs
class GroupByEqualitySample (line 8) | public static class GroupByEqualitySample
method MainTest (line 10) | public static void MainTest()
class Student (line 64) | private sealed class Student
class StudentResult (line 70) | private sealed class StudentResult
FILE: samples/DotNetCoreSample/HttpRequesterTest.cs
class HttpRequesterTest (line 6) | internal class HttpRequesterTest
method MainTest (line 8) | public static void MainTest()
FILE: samples/DotNetCoreSample/InMemoryStreamTest.cs
class InMemoryStreamTest (line 9) | internal static class InMemoryStreamTest
method MainTest (line 11) | public static async Task MainTest()
FILE: samples/DotNetCoreSample/LoggerTest.cs
class LoggerTest (line 8) | internal class LoggerTest
method MainTest (line 10) | public static void MainTest()
method MicrosoftLoggingTest (line 35) | public static void MicrosoftLoggingTest()
class GenericTest (line 75) | private class GenericTest<T>(ILogger<GenericTest<T>> logger)
method Test (line 77) | public void Test() => logger.LogInformation("test");
FILE: samples/DotNetCoreSample/MapperTest.cs
class MapperTest (line 5) | internal class MapperTest
class MapperA (line 7) | private class MapperA
class MapperB (line 16) | private class MapperB
method Test (line 23) | public static void Test()
FILE: samples/DotNetCoreSample/NewtonJsonFormatter.cs
class NewtonJsonFormatterOptions (line 14) | public sealed class NewtonJsonFormatterOptions : ConsoleFormatterOptions
class NewtonJsonFormatter (line 18) | public sealed class NewtonJsonFormatter(IOptions<NewtonJsonFormatterOpti...
method Write (line 24) | public override void Write<TState>(in LogEntry<TState> logEntry, IExte...
class LoggingBuilderExtensions (line 78) | public static partial class LoggingBuilderExtensions
method AddNewtonJsonConsole (line 80) | public static ILoggingBuilder AddNewtonJsonConsole(this ILoggingBuilde...
class NewtonJsonFormatterTest (line 93) | public static class NewtonJsonFormatterTest
method MainTest (line 95) | public static void MainTest()
FILE: samples/DotNetCoreSample/PagedListResultTest.cs
class PagedListResultTest (line 5) | public class PagedListResultTest
method MainTest (line 7) | public static void MainTest()
FILE: samples/DotNetCoreSample/PipelineTest.cs
class PipelineTest (line 7) | public class PipelineTest
method Test (line 9) | public static void Test()
method MiddlewareTest (line 66) | public static void MiddlewareTest()
method TestV2 (line 76) | public static void TestV2()
method AsyncPipelineBuilderTest (line 138) | public static async Task AsyncPipelineBuilderTest()
method AsyncPipelineBuilderTestV2 (line 196) | public static async Task AsyncPipelineBuilderTestV2()
class RequestContext (line 245) | file class RequestContext
class FooMiddleware (line 252) | file class FooMiddleware : IPipelineMiddleware<RequestContext>, IAsyncPi...
method Invoke (line 254) | public void Invoke(RequestContext context, Action<RequestContext> next)
method InvokeAsync (line 260) | public Task InvokeAsync(RequestContext context, Func<RequestContext, T...
class BarMiddleware (line 267) | file class BarMiddleware : IPipelineMiddleware<RequestContext>, IAsyncPi...
method Invoke (line 269) | public void Invoke(RequestContext context, Action<RequestContext> next)
method InvokeAsync (line 275) | public Task InvokeAsync(RequestContext context, Func<RequestContext, T...
FILE: samples/DotNetCoreSample/ProcessExecutorTest.cs
class ProcessExecutorTest (line 6) | public class ProcessExecutorTest
method RawProcessTest (line 8) | public static void RawProcessTest()
method DotNetInfoTest (line 37) | public static void DotNetInfoTest()
method DotNetNugetGlobalPackagesInfoTest (line 48) | public static void DotNetNugetGlobalPackagesInfoTest()
FILE: samples/DotNetCoreSample/Program.cs
type TestStruct (line 364) | internal struct TestStruct
class TestClass (line 369) | internal class TestClass
FILE: samples/DotNetCoreSample/RepositoryTest.cs
class RepositoryTest (line 11) | public static class RepositoryTest
method MainTest (line 13) | public static void MainTest()
class DbConnectionPool (line 52) | public class DbConnectionPool : DefaultObjectPool<DbConnection>
method DbConnectionPool (line 54) | public DbConnectionPool(IPooledObjectPolicy<DbConnection> policy) : ...
method DbConnectionPool (line 58) | public DbConnectionPool(IPooledObjectPolicy<DbConnection> policy, in...
class DbConnectionPoolPolicy (line 63) | public class DbConnectionPoolPolicy(string connString) : IPooledObject...
method Create (line 67) | public DbConnection Create()
method Return (line 72) | public bool Return(DbConnection obj)
FILE: samples/DotNetCoreSample/RequestHelperTest.cs
class RequestHelperTest (line 8) | internal class RequestHelperTest
method GetRequestParamTest (line 12) | public static void GetRequestParamTest()
method GetParamInfo (line 29) | private static NameValueCollection GetParamInfo(string url)
FILE: samples/DotNetCoreSample/SerilogTest.cs
class SerilogTest (line 7) | public static class SerilogTest
method MainTest (line 9) | public static void MainTest()
FILE: samples/DotNetCoreSample/ServiceDecoratorTest.cs
class ServiceDecoratorTest (line 8) | internal class ServiceDecoratorTest
method MainTest (line 10) | public static void MainTest()
type IJob (line 22) | private interface IJob
method Execute (line 25) | void Execute();
class Sleepy (line 28) | private sealed class Sleepy : IJob
method Execute (line 32) | public void Execute()
class JobDecorator (line 38) | private sealed class JobDecorator(IJob job) : IJob
method Execute (line 44) | public void Execute()
FILE: samples/DotNetCoreSample/TaskTest.cs
class TaskTest (line 5) | internal static class TaskTest
method TaskWhenAllTest (line 7) | public static async Task TaskWhenAllTest()
FILE: samples/DotNetCoreSample/TemplatingSample.cs
class TemplatingSample (line 10) | public static class TemplatingSample
method MainTest (line 12) | public static async Task MainTest()
FILE: samples/DotNetCoreSample/Test/PagedListModel1.cs
class PagedListModel1 (line 5) | public class PagedListModel1<T> : IEnumerable<T>
method GetEnumerator (line 57) | public IEnumerator<T> GetEnumerator()
method GetEnumerator (line 62) | IEnumerator IEnumerable.GetEnumerator()
FILE: samples/DotNetCoreSample/TotpTest.cs
class TotpTest (line 9) | public class TotpTest
method MainTest (line 11) | public static void MainTest()
FILE: src/WeihanLi.Common.Logging.Serilog/SerilogHelper.cs
class SerilogHelper (line 5) | public static class SerilogHelper
method LogInit (line 9) | public static void LogInit(Action<LoggerConfiguration> configureAction)
method LogInit (line 18) | public static void LogInit(LoggerConfiguration loggerConfiguration)
FILE: src/WeihanLi.Common.Logging.Serilog/SerilogLogHelperProvider.cs
class SerilogLogHelperProvider (line 8) | internal sealed class SerilogLogHelperProvider : ILogHelperProvider, IDi...
method SerilogLogHelperProvider (line 12) | public SerilogLogHelperProvider(LoggerConfiguration configuration)
method SerilogLogHelperProvider (line 17) | public SerilogLogHelperProvider(Action<LoggerConfiguration> configurat...
method Dispose (line 22) | public void Dispose()
method Log (line 27) | public void Log(LogHelperLoggingEvent loggingEvent)
method GetSerilogEventLevel (line 49) | private static LogEventLevel GetSerilogEventLevel(LogHelperLogLevel lo...
class LogHelperFactoryExtensions (line 68) | public static class LogHelperFactoryExtensions
method AddSerilog (line 70) | public static ILogHelperLoggingBuilder AddSerilog(this ILogHelperLoggi...
method AddSerilog (line 76) | public static ILogHelperLoggingBuilder AddSerilog(this ILogHelperLoggi...
FILE: src/WeihanLi.Common.Logging.Serilog/SerilogLogger.cs
class SerilogLogger (line 14) | internal sealed class SerilogLogger : FrameworkLogger
method SerilogLogger (line 21) | public SerilogLogger(
method IsEnabled (line 37) | public bool IsEnabled(LogLevel logLevel)
method BeginScope (line 42) | public IDisposable? BeginScope<TState>(TState state) where TState : no...
method Log (line 47) | public void Log<TState>(LogLevel logLevel, EventId eventId, TState sta...
method AsLoggableValue (line 120) | private static object? AsLoggableValue<TState>(TState state, Func<TSta...
method ConvertLevel (line 128) | private static LogEventLevel ConvertLevel(LogLevel logLevel)
method CreateEventIdProperty (line 142) | private static LogEventProperty CreateEventIdProperty(EventId eventId)
FILE: src/WeihanLi.Common.Logging.Serilog/SerilogLoggerExtensions.cs
class SerilogLoggerExtensions (line 9) | public static class SerilogLoggerExtensions
method AddSerilog (line 20) | public static ILoggerFactory AddSerilog(
method AddSerilog (line 41) | public static ILoggingBuilder AddSerilog(this ILoggingBuilder builder,...
FILE: src/WeihanLi.Common.Logging.Serilog/SerilogLoggerProvider.cs
class SerilogLoggerProvider (line 16) | [ProviderAlias("Serilog")]
method SerilogLoggerProvider (line 32) | public SerilogLoggerProvider(ILogger? logger = null, bool dispose = fa...
method CreateLogger (line 46) | public FrameworkLogger CreateLogger(string categoryName)
method BeginScope (line 51) | public IDisposable BeginScope<T>(T state)
method Enrich (line 65) | public void Enrich(LogEvent logEvent, ILogEventPropertyFactory propert...
method Dispose (line 94) | public void Dispose()
FILE: src/WeihanLi.Common.Logging.Serilog/SerilogLoggerScope.cs
class SerilogLoggerScope (line 10) | internal sealed class SerilogLoggerScope : IDisposable
method SerilogLoggerScope (line 21) | public SerilogLoggerScope(SerilogLoggerProvider provider, object? stat...
method Dispose (line 33) | public void Dispose()
method EnrichAndCreateScopeItem (line 51) | public void EnrichAndCreateScopeItem(LogEvent logEvent, ILogEventPrope...
FILE: src/WeihanLi.Common/Abstractions/Properties.cs
type IProperties (line 6) | public interface IProperties
type IStringProperties (line 11) | public interface IStringProperties
FILE: src/WeihanLi.Common/Aspect/AspectDelegate.cs
class AspectDelegate (line 6) | public static class AspectDelegate
method Invoke (line 8) | [RequiresUnreferencedCode("Unreferenced code may be used.")]
method InvokeWithInterceptors (line 14) | [RequiresUnreferencedCode("Unreferenced code may be used.")]
method InvokeWithCompleteFunc (line 20) | [RequiresUnreferencedCode("Unreferenced code may be used.")]
method InvokeInternal (line 26) | [RequiresDynamicCode("Defining a dynamic assembly requires dynamic cod...
method GetAspectDelegate (line 90) | [RequiresDynamicCode("Defining a dynamic assembly requires dynamic cod...
FILE: src/WeihanLi.Common/Aspect/AspectInvokeException.cs
class AspectInvokeException (line 3) | public sealed class AspectInvokeException(IInvocation invocation, Except...
FILE: src/WeihanLi.Common/Aspect/AttributeInterceptorResolver.cs
class AbstractInterceptor (line 7) | public abstract class AbstractInterceptor : Attribute, IInterceptor
method Invoke (line 9) | public abstract Task Invoke(IInvocation invocation, Func<Task> next);
class NoIntercept (line 12) | public sealed class NoIntercept : Attribute;
class AttributeInterceptorResolver (line 14) | public class AttributeInterceptorResolver : IInterceptorResolver
method ResolveInterceptors (line 16) | [RequiresUnreferencedCode("Unreferenced code may be used")]
FILE: src/WeihanLi.Common/Aspect/DefaultProxyFactory.cs
class DefaultProxyFactory (line 6) | public sealed class DefaultProxyFactory
method CreateProxy (line 12) | [RequiresDynamicCode("Defining a dynamic assembly requires dynamic cod...
method CreateProxy (line 23) | [RequiresDynamicCode("Defining a dynamic assembly requires dynamic cod...
method CreateProxyWithTarget (line 42) | [RequiresDynamicCode("Defining a dynamic assembly requires dynamic cod...
FILE: src/WeihanLi.Common/Aspect/DefaultProxyTypeFactory.cs
class DefaultProxyTypeFactory (line 3) | public sealed class DefaultProxyTypeFactory : IProxyTypeFactory
method CreateProxyType (line 7) | [RequiresDynamicCode("Defining a dynamic assembly requires dynamic cod...
method CreateProxyType (line 20) | [RequiresDynamicCode("Defining a dynamic assembly requires dynamic cod...
FILE: src/WeihanLi.Common/Aspect/DelegateInterceptor.cs
class DelegateInterceptor (line 3) | [CLSCompliant(false)]
method Invoke (line 8) | public override Task Invoke(IInvocation invocation, Func<Task> next)
method FromDelegate (line 13) | public static DelegateInterceptor FromDelegate(Func<IInvocation, Func<...
FILE: src/WeihanLi.Common/Aspect/FluentAspectOptions.cs
class FluentAspectOptions (line 3) | public sealed class FluentAspectOptions
FILE: src/WeihanLi.Common/Aspect/FluentAspectOptionsExtensions.cs
class FluentAspectOptionsExtensions (line 9) | public static class FluentAspectOptionsExtensions
method Intercept (line 13) | public static IInterceptionConfiguration Intercept(this FluentAspectOp...
method InterceptAll (line 29) | public static IInterceptionConfiguration InterceptAll(this FluentAspec...
method InterceptType (line 32) | public static IInterceptionConfiguration InterceptType(this FluentAspe...
method InterceptMethod (line 40) | public static IInterceptionConfiguration InterceptMethod<T>(this Fluen...
method InterceptMethod (line 46) | public static IInterceptionConfiguration InterceptMethod<T>(this Fluen...
method InterceptMethod (line 55) | public static IInterceptionConfiguration InterceptMethod(this FluentAs...
method InterceptPropertyGetter (line 64) | public static IInterceptionConfiguration InterceptPropertyGetter<[Dyna...
method InterceptPropertySetter (line 81) | public static IInterceptionConfiguration InterceptPropertySetter<[Dyna...
method InterceptMethod (line 98) | public static IInterceptionConfiguration InterceptMethod<T>(this Fluen...
method InterceptType (line 104) | public static IInterceptionConfiguration InterceptType<T>(this FluentA...
method InterceptMethod (line 109) | public static IInterceptionConfiguration InterceptMethod<T>(this Fluen...
method InterceptMethod (line 117) | public static IInterceptionConfiguration InterceptMethod(this FluentAs...
method InterceptMethod (line 123) | public static IInterceptionConfiguration InterceptMethod<T>(this Fluen...
method NoIntercept (line 142) | public static bool NoIntercept(this FluentAspectOptions options, Func<...
method NoInterceptMethod (line 147) | public static FluentAspectOptions NoInterceptMethod<T>(this FluentAspe...
method NoInterceptMethod (line 154) | public static FluentAspectOptions NoInterceptMethod<T>(this FluentAspe...
method NoInterceptType (line 161) | public static FluentAspectOptions NoInterceptType(this FluentAspectOpt...
method NoInterceptType (line 170) | public static FluentAspectOptions NoInterceptType<T>(this FluentAspect...
method NoInterceptMethod (line 176) | public static FluentAspectOptions NoInterceptMethod<T>(this FluentAspe...
method NoInterceptMethod (line 185) | public static FluentAspectOptions NoInterceptMethod<T>(this FluentAspe...
method NoInterceptMethod (line 200) | public static FluentAspectOptions NoInterceptMethod(this FluentAspectO...
method NoInterceptMethod (line 207) | public static FluentAspectOptions NoInterceptMethod<T>(this FluentAspe...
method NoInterceptMethod (line 216) | public static FluentAspectOptions NoInterceptMethod(this FluentAspectO...
method NoInterceptProperty (line 225) | public static FluentAspectOptions NoInterceptProperty<[DynamicallyAcce...
method NoInterceptPropertyGetter (line 245) | public static FluentAspectOptions NoInterceptPropertyGetter<[Dynamical...
method NoInterceptPropertySetter (line 262) | public static FluentAspectOptions NoInterceptPropertySetter<[Dynamical...
method UseInterceptorResolver (line 283) | public static FluentAspectOptions UseInterceptorResolver(this FluentAs...
method UseInterceptorResolver (line 291) | public static FluentAspectOptions UseInterceptorResolver<TResolver>(th...
method UseProxyFactory (line 302) | public static FluentAspectOptions UseProxyFactory(this FluentAspectOpt...
method UseProxyFactory (line 308) | public static FluentAspectOptions UseProxyFactory<TProxyFactory>(this ...
method UseProxyFactory (line 315) | public static FluentAspectOptions UseProxyFactory<[DynamicallyAccessed...
method WithProperty (line 326) | public static FluentAspectOptions WithProperty(this FluentAspectOption...
method WithProperty (line 333) | public static FluentAspectOptions WithProperty(this FluentAspectOption...
method WithEnricher (line 340) | public static FluentAspectOptions WithEnricher<TEnricher>(this FluentA...
method WithEnricher (line 346) | public static FluentAspectOptions WithEnricher<TEnricher>(this FluentA...
FILE: src/WeihanLi.Common/Aspect/FluentAspects.cs
class FluentAspects (line 3) | public static class FluentAspects
method FluentAspects (line 7) | static FluentAspects()
method Configure (line 21) | public static void Configure(Action<FluentAspectOptions> optionsAction)
FILE: src/WeihanLi.Common/Aspect/FluentAspectsBuilder.cs
type IFluentAspectsBuilder (line 5) | public interface IFluentAspectsBuilder
class FluentAspectsBuilder (line 10) | internal sealed class FluentAspectsBuilder(IServiceCollection serviceCol...
FILE: src/WeihanLi.Common/Aspect/FluentAspectsServiceContainerBuilder.cs
type IFluentAspectsServiceContainerBuilder (line 5) | public interface IFluentAspectsServiceContainerBuilder
class FluentAspectsServiceContainerBuilder (line 10) | internal sealed class FluentAspectsServiceContainerBuilder(IServiceConta...
FILE: src/WeihanLi.Common/Aspect/FluentConfigInterceptorResolver.cs
class FluentConfigInterceptorResolver (line 3) | public sealed class FluentConfigInterceptorResolver : IInterceptorResolver
method FluentConfigInterceptorResolver (line 7) | private FluentConfigInterceptorResolver()
method ResolveInterceptors (line 11) | public IReadOnlyList<IInterceptor> ResolveInterceptors(IInvocation inv...
FILE: src/WeihanLi.Common/Aspect/IInterceptionConfiguration.cs
type IInterceptionConfiguration (line 6) | public interface IInterceptionConfiguration
class InterceptionConfiguration (line 11) | internal class InterceptionConfiguration : IInterceptionConfiguration
method InterceptionConfiguration (line 15) | public InterceptionConfiguration()
class InterceptionConfigurationExtensions (line 21) | public static class InterceptionConfigurationExtensions
method With (line 23) | public static IInterceptionConfiguration With(this IInterceptionConfig...
method With (line 31) | public static IInterceptionConfiguration With(this IInterceptionConfig...
method With (line 37) | public static IInterceptionConfiguration With<TInterceptor>(this IInte...
method With (line 43) | public static IInterceptionConfiguration With<[DynamicallyAccessedMemb...
FILE: src/WeihanLi.Common/Aspect/IInterceptor.cs
type IInterceptor (line 3) | public interface IInterceptor
method Invoke (line 5) | Task Invoke(IInvocation invocation, Func<Task> next);
class TryInvokeInterceptor (line 8) | public class TryInvokeInterceptor : IInterceptor
method Invoke (line 10) | public async Task Invoke(IInvocation invocation, Func<Task> next)
class DisposableInterceptor (line 23) | internal sealed class DisposableInterceptor : IInterceptor
method Invoke (line 25) | public async Task Invoke(IInvocation invocation, Func<Task> next)
FILE: src/WeihanLi.Common/Aspect/IInterceptorResolver.cs
type IInterceptorResolver (line 3) | public interface IInterceptorResolver
method ResolveInterceptors (line 5) | [RequiresUnreferencedCode("Unreferenced code may be used")]
FILE: src/WeihanLi.Common/Aspect/IInvocation.cs
type IInvocation (line 6) | public interface IInvocation
class AspectInvocation (line 25) | public class AspectInvocation : IInvocation
method AspectInvocation (line 43) | [RequiresDynamicCode("The native code for this instantiation might not...
FILE: src/WeihanLi.Common/Aspect/IProxyFactory.cs
type IProxyFactory (line 5) | public interface IProxyFactory
method CreateProxy (line 7) | [RequiresDynamicCode("Defining a dynamic assembly requires dynamic cod...
method CreateProxy (line 11) | [RequiresDynamicCode("Defining a dynamic assembly requires dynamic cod...
method CreateProxyWithTarget (line 15) | [RequiresDynamicCode("Defining a dynamic assembly requires dynamic cod...
FILE: src/WeihanLi.Common/Aspect/IProxyTypeFactory.cs
type IProxyTypeFactory (line 3) | public interface IProxyTypeFactory
method CreateProxyType (line 5) | [RequiresDynamicCode("Defining a dynamic assembly requires dynamic cod...
method CreateProxyType (line 9) | [RequiresDynamicCode("Defining a dynamic assembly requires dynamic cod...
FILE: src/WeihanLi.Common/Aspect/InternalAspectHelper.cs
class MethodInvokeHelper (line 5) | internal static class MethodInvokeHelper
FILE: src/WeihanLi.Common/Aspect/InvocationEnricher.cs
type IInvocationEnricher (line 5) | public interface IInvocationEnricher : IEnricher<IInvocation>;
class PropertyInvocationEnricher (line 7) | public sealed class PropertyInvocationEnricher : PropertyEnricher<IInvoc...
method PropertyInvocationEnricher (line 9) | public PropertyInvocationEnricher(string propertyName, object property...
method PropertyInvocationEnricher (line 13) | public PropertyInvocationEnricher(string propertyName, Func<IInvocatio...
method PropertyInvocationEnricher (line 17) | public PropertyInvocationEnricher(string propertyName, Func<IInvocatio...
FILE: src/WeihanLi.Common/Aspect/InvocationEnricherExtensions.cs
class InvocationEnricherExtensions (line 3) | public static class InvocationEnricherExtensions
method AddProperty (line 5) | public static void AddProperty(this IInvocation invocation, string pro...
method AddProperty (line 16) | public static void AddProperty(this IInvocation invocation, string pro...
FILE: src/WeihanLi.Common/Aspect/MethodSignature.cs
class MethodSignature (line 5) | internal sealed class MethodSignature(string methodName, IReadOnlyList<T...
method MethodSignature (line 10) | public MethodSignature(MethodBase method) : this(method.Name, method.G...
method Equals (line 14) | public override bool Equals(object? obj)
method GetHashCode (line 40) | public override int GetHashCode()
class MethodSignatureExtensions (line 48) | internal static class MethodSignatureExtensions
method GetSignature (line 50) | public static MethodSignature GetSignature(this MethodBase method)
FILE: src/WeihanLi.Common/Aspect/ProxyFactoryExtensions.cs
class ProxyFactoryExtensions (line 5) | public static class ProxyFactoryExtensions
method CreateInterfaceProxy (line 7) | [RequiresDynamicCode("Defining a dynamic assembly requires dynamic cod...
method CreateInterfaceProxy (line 20) | [RequiresDynamicCode("Defining a dynamic assembly requires dynamic cod...
method CreateInterfaceProxy (line 33) | [RequiresDynamicCode("Defining a dynamic assembly requires dynamic cod...
method CreateClassProxy (line 46) | [RequiresDynamicCode("Defining a dynamic assembly requires dynamic cod...
method CreateClassProxy (line 58) | [RequiresDynamicCode("Defining a dynamic assembly requires dynamic cod...
method CreateClassProxy (line 71) | [RequiresDynamicCode("Defining a dynamic assembly requires dynamic cod...
method CreateProxy (line 86) | [RequiresDynamicCode("Defining a dynamic assembly requires dynamic cod...
method CreateProxy (line 93) | [RequiresDynamicCode("Defining a dynamic assembly requires dynamic cod...
method CreateProxy (line 100) | [RequiresDynamicCode("Defining a dynamic assembly requires dynamic cod...
method CreateProxyWithTarget (line 113) | [RequiresDynamicCode("Defining a dynamic assembly requires dynamic cod...
method CreateProxyWithTarget (line 122) | [RequiresDynamicCode("Defining a dynamic assembly requires dynamic cod...
method CreateProxyWithTarget (line 130) | [RequiresDynamicCode("Defining a dynamic assembly requires dynamic cod...
method CreateProxyWithTarget (line 138) | [RequiresDynamicCode("Defining a dynamic assembly requires dynamic cod...
FILE: src/WeihanLi.Common/Aspect/ProxyUtils.cs
class ProxyUtils (line 8) | [RequiresDynamicCode("Defining a dynamic assembly requires dynamic code.")]
method ProxyUtils (line 33) | static ProxyUtils()
method IsProxyType (line 47) | public static bool IsProxyType(this Type type)
method GetFriendlyTypeName (line 52) | private static string GetFriendlyTypeName(this Type? type)
method CreateInterfaceProxy (line 74) | [RequiresDynamicCode("Defining a dynamic assembly requires dynamic cod...
method CreateInterfaceProxy (line 199) | [RequiresDynamicCode("Defining a dynamic assembly requires dynamic cod...
method CreateClassProxy (line 313) | [RequiresDynamicCode("Defining a dynamic assembly requires dynamic cod...
method SetProxyTarget (line 429) | [RequiresDynamicCode("Defining a dynamic assembly requires dynamic cod...
class MethodUtils (line 444) | private static class MethodUtils
method DefineInterfaceMethod (line 446) | [RequiresDynamicCode("Defining a dynamic assembly requires dynamic c...
method DefineClassMethod (line 559) | [RequiresDynamicCode("Defining a dynamic assembly requires dynamic c...
class GenericParameterUtils (line 682) | private static class GenericParameterUtils
method DefineGenericParameter (line 684) | [RequiresDynamicCode("Defining a dynamic assembly requires dynamic c...
method DefineGenericParameter (line 712) | [RequiresDynamicCode("Defining a dynamic assembly requires dynamic c...
method ToClassGenericParameterAttributes (line 740) | private static GenericParameterAttributes ToClassGenericParameterAtt...
method DefineCustomAttribute (line 770) | [RequiresDynamicCode("Defining a dynamic assembly requires dynamic cod...
method ReadAttributeValue (line 803) | private static object? ReadAttributeValue(CustomAttributeTypedArgument...
method CreateType (line 820) | private static Type CreateType(this TypeBuilder typeBuilder)
FILE: src/WeihanLi.Common/Aspect/ServiceCollectionExtensions.cs
class ServiceCollectionExtensions (line 8) | public static class ServiceCollectionExtensions
method AddFluentAspects (line 10) | public static IFluentAspectsBuilder AddFluentAspects(this IServiceColl...
method AddFluentAspects (line 18) | public static IFluentAspectsBuilder AddFluentAspects(this IServiceColl...
method AddProxyService (line 29) | [RequiresDynamicCode("Defining a dynamic assembly requires dynamic cod...
method AddSingletonProxy (line 43) | [RequiresDynamicCode("Defining a dynamic assembly requires dynamic cod...
method AddScopedProxy (line 52) | [RequiresDynamicCode("Defining a dynamic assembly requires dynamic cod...
method AddTransientProxy (line 61) | [RequiresDynamicCode("Defining a dynamic assembly requires dynamic cod...
method AddProxyService (line 70) | [RequiresDynamicCode("Defining a dynamic assembly requires dynamic cod...
method AddSingletonProxy (line 84) | [RequiresDynamicCode("Defining a dynamic assembly requires dynamic cod...
method AddScopedProxy (line 90) | [RequiresDynamicCode("Defining a dynamic assembly requires dynamic cod...
method AddTransientProxy (line 96) | [RequiresDynamicCode("Defining a dynamic assembly requires dynamic cod...
method BuildFluentAspectsProvider (line 102) | [RequiresDynamicCode("Defining a dynamic assembly requires dynamic cod...
FILE: src/WeihanLi.Common/Aspect/ServiceContainerBuilderExtensions.cs
class ServiceContainerBuilderExtensions (line 8) | public static class ServiceContainerBuilderExtensions
method AddFluentAspects (line 10) | public static IFluentAspectsServiceContainerBuilder AddFluentAspects(t...
method AddFluentAspects (line 18) | public static IFluentAspectsServiceContainerBuilder AddFluentAspects(t...
method AddProxyService (line 29) | [RequiresDynamicCode("Defining a dynamic assembly requires dynamic cod...
method AddSingletonProxy (line 45) | [RequiresDynamicCode("Defining a dynamic assembly requires dynamic cod...
method AddScopedProxy (line 55) | [RequiresDynamicCode("Defining a dynamic assembly requires dynamic cod...
method AddTransientProxy (line 65) | [RequiresDynamicCode("Defining a dynamic assembly requires dynamic cod...
method AddProxyService (line 75) | [RequiresDynamicCode("Defining a dynamic assembly requires dynamic cod...
method AddSingletonProxy (line 90) | [RequiresDynamicCode("Defining a dynamic assembly requires dynamic cod...
method AddScopedProxy (line 96) | [RequiresDynamicCode("Defining a dynamic assembly requires dynamic cod...
method AddTransientProxy (line 102) | [RequiresDynamicCode("Defining a dynamic assembly requires dynamic cod...
method BuildFluentAspectsContainer (line 108) | [RequiresDynamicCode("Defining a dynamic assembly requires dynamic cod...
FILE: src/WeihanLi.Common/CacheUtil.cs
class CacheUtil (line 8) | public static class CacheUtil
method GetTypeProperties (line 13) | public static PropertyInfo[] GetTypeProperties([DynamicallyAccessedMem...
method GetTypeFields (line 19) | public static FieldInfo[] GetTypeFields([DynamicallyAccessedMembers(Dy...
class StrongTypedCache (line 40) | internal static class StrongTypedCache<T>
FILE: src/WeihanLi.Common/Compressor/DataCompressor.cs
type IDataCompressor (line 8) | public interface IDataCompressor
method Compress (line 15) | byte[] Compress(byte[] sourceData);
method CompressAsync (line 22) | Task<byte[]> CompressAsync(byte[] sourceData);
method Decompress (line 29) | byte[] Decompress(byte[] compressedData);
method DecompressAsync (line 36) | Task<byte[]> DecompressAsync(byte[] compressedData);
class NullDataCompressor (line 43) | public sealed class NullDataCompressor : IDataCompressor
method Compress (line 45) | public byte[] Compress(byte[] sourceData)
method CompressAsync (line 50) | public Task<byte[]> CompressAsync(byte[] sourceData)
method Decompress (line 55) | public byte[] Decompress(byte[] compressedData)
method DecompressAsync (line 60) | public Task<byte[]> DecompressAsync(byte[] compressedData)
class GZipDataCompressor (line 69) | public class GZipDataCompressor : IDataCompressor
method Compress (line 71) | public byte[] Compress(byte[] sourceData)
method CompressAsync (line 76) | public Task<byte[]> CompressAsync(byte[] sourceData)
method Decompress (line 81) | public byte[] Decompress(byte[] compressedData)
method DecompressAsync (line 86) | public Task<byte[]> DecompressAsync(byte[] compressedData)
FILE: src/WeihanLi.Common/Data/Expressions/DateTimeExpressionParser.cs
class SqlExpressionParser (line 9) | internal static partial class SqlExpressionParser
method ParseDateTimeMemberAccess (line 11) | public static string ParseDateTimeMemberAccess(MemberExpression exp, I...
method ParseDateTimeMethodCall (line 22) | public static string ParseDateTimeMethodCall(MethodCallExpression exp,...
FILE: src/WeihanLi.Common/Data/Expressions/StringExpressionParser.cs
class SqlExpressionParser (line 9) | internal static partial class SqlExpressionParser
method ParseStringMemberAccess (line 11) | public static string ParseStringMemberAccess(MemberExpression exp, IDi...
method ParseStringMethodCall (line 21) | public static string ParseStringMethodCall(MethodCallExpression exp, I...
FILE: src/WeihanLi.Common/Data/IRepository.cs
type IReadOnlyRepository (line 6) | public interface IReadOnlyRepository<TEntity>
method Count (line 11) | int Count(Expression<Func<TEntity, bool>> whereExpression);
method CountAsync (line 13) | Task<int> CountAsync(Expression<Func<TEntity, bool>> whereExpression, ...
method LongCount (line 18) | long LongCount(Expression<Func<TEntity, bool>> whereExpression);
method LongCountAsync (line 20) | Task<long> LongCountAsync(Expression<Func<TEntity, bool>> whereExpress...
method Exist (line 25) | bool Exist(Expression<Func<TEntity, bool>> whereExpression);
method ExistAsync (line 27) | Task<bool> ExistAsync(Expression<Func<TEntity, bool>> whereExpression,...
method Fetch (line 32) | TEntity? Fetch(Expression<Func<TEntity, bool>> whereExpression);
method FetchAsync (line 34) | Task<TEntity?> FetchAsync(Expression<Func<TEntity, bool>> whereExpress...
method Fetch (line 36) | TEntity? Fetch<TProperty>(Expression<Func<TEntity, bool>> whereExpress...
method FetchAsync (line 38) | Task<TEntity?> FetchAsync<TProperty>(Expression<Func<TEntity, bool>> w...
method Select (line 45) | List<TEntity> Select(Expression<Func<TEntity, bool>> whereExpression);
method SelectAsync (line 53) | Task<List<TEntity>> SelectAsync(Expression<Func<TEntity, bool>> whereE...
method Select (line 63) | List<TEntity> Select<TProperty>(int count, Expression<Func<TEntity, bo...
method SelectAsync (line 74) | Task<List<TEntity>> SelectAsync<TProperty>(int count, Expression<Func<...
method Paged (line 86) | IPagedListResult<TEntity> Paged<TProperty>(int pageNumber, int pageSiz...
method PagedAsync (line 99) | Task<IPagedListResult<TEntity>> PagedAsync<TProperty>(int pageNumber, ...
type IRepository (line 106) | public interface IRepository<TEntity> : IReadOnlyRepository<TEntity>
method Insert (line 112) | int Insert(TEntity entity);
method InsertAsync (line 119) | Task<int> InsertAsync(TEntity entity, CancellationToken cancellationTo...
method Insert (line 125) | int Insert(IEnumerable<TEntity> entities);
method InsertAsync (line 133) | Task<int> InsertAsync(IEnumerable<TEntity> entities, CancellationToken...
method Update (line 143) | int Update<TProperty>(Expression<Func<TEntity, bool>> whereExpression,...
method UpdateAsync (line 154) | Task<int> UpdateAsync<TProperty>(Expression<Func<TEntity, bool>> where...
method Update (line 162) | int Update(Expression<Func<TEntity, bool>> whereExpression, IDictionar...
method Update (line 170) | int Update(TEntity entity, params Expression<Func<TEntity, object?>>[]...
method UpdateWithout (line 178) | int UpdateWithout(TEntity entity, params Expression<Func<TEntity, obje...
method Update (line 186) | int Update(TEntity entity, params string[] propertyNames);
method UpdateWithout (line 194) | int UpdateWithout(TEntity entity, params string[] propertyNames);
method UpdateWithoutAsync (line 203) | Task<int> UpdateWithoutAsync(TEntity entity, string[] propertyNames, C...
method UpdateAsync (line 212) | Task<int> UpdateAsync(TEntity entity, Expression<Func<TEntity, object?...
method UpdateWithoutAsync (line 221) | Task<int> UpdateWithoutAsync(TEntity entity, Expression<Func<TEntity, ...
method UpdateAsync (line 230) | Task<int> UpdateAsync(TEntity entity, string[] propertyNames, Cancella...
method UpdateAsync (line 239) | Task<int> UpdateAsync(Expression<Func<TEntity, bool>> whereExpression,...
method Delete (line 245) | int Delete(Expression<Func<TEntity, bool>> whereExpression);
method Delete (line 252) | int Delete(TEntity entity);
method DeleteAsync (line 259) | Task<int> DeleteAsync(Expression<Func<TEntity, bool>> whereExpression,...
method DeleteAsync (line 267) | Task<int> DeleteAsync(TEntity entity, CancellationToken cancellationTo...
FILE: src/WeihanLi.Common/Data/IUnitOfWork.cs
type IUnitOfWork (line 3) | public interface IUnitOfWork
method Commit (line 5) | void Commit();
method CommitAsync (line 7) | Task CommitAsync(CancellationToken cancellationToken = default);
method Rollback (line 9) | void Rollback();
method RollbackAsync (line 11) | Task RollbackAsync(CancellationToken cancellationToken = default);
FILE: src/WeihanLi.Common/Data/Repository.cs
class Repository (line 13) | [CLSCompliant(false)]
method Count (line 55) | public virtual int Count(Expression<Func<TEntity, bool>> whereExpression)
method CountAsync (line 66) | public virtual Task<int> CountAsync(Expression<Func<TEntity, bool>> wh...
method LongCount (line 77) | public virtual long LongCount(Expression<Func<TEntity, bool>> whereExp...
method LongCountAsync (line 88) | public virtual Task<long> LongCountAsync(Expression<Func<TEntity, bool...
method Exist (line 99) | public virtual bool Exist(Expression<Func<TEntity, bool>> whereExpress...
method ExistAsync (line 106) | public virtual Task<bool> ExistAsync(Expression<Func<TEntity, bool>> w...
method Fetch (line 113) | public virtual TEntity? Fetch(Expression<Func<TEntity, bool>> whereExp...
method FetchAsync (line 123) | public virtual Task<TEntity?> FetchAsync(Expression<Func<TEntity, bool...
method Fetch (line 133) | public virtual TEntity? Fetch<TProperty>(Expression<Func<TEntity, bool...
method FetchAsync (line 144) | public virtual Task<TEntity?> FetchAsync<TProperty>(Expression<Func<TE...
method Select (line 155) | public virtual List<TEntity> Select(Expression<Func<TEntity, bool>> wh...
method SelectAsync (line 165) | public virtual Task<List<TEntity>> SelectAsync(Expression<Func<TEntity...
method Select (line 175) | public virtual List<TEntity> Select<TProperty>(int count, Expression<F...
method SelectAsync (line 186) | public virtual Task<List<TEntity>> SelectAsync<TProperty>(int count, E...
method Paged (line 197) | public virtual IPagedListResult<TEntity> Paged<TProperty>(int pageNumb...
method PagedAsync (line 231) | public virtual async Task<IPagedListResult<TEntity>> PagedAsync<TPrope...
method Insert (line 265) | public virtual int Insert(TEntity entity)
method InsertAsync (line 286) | public virtual Task<int> InsertAsync(TEntity entity, CancellationToken...
method Insert (line 305) | public virtual int Insert(IEnumerable<TEntity> entities)
method InsertAsync (line 341) | public virtual Task<int> InsertAsync(IEnumerable<TEntity> entities, Ca...
method Update (line 378) | public virtual int Update<TProperty>(Expression<Func<TEntity, bool>> w...
method UpdateAsync (line 391) | public virtual Task<int> UpdateAsync<TProperty>(Expression<Func<TEntit...
method Update (line 404) | public virtual int Update(Expression<Func<TEntity, bool>> whereExpress...
method Update (line 423) | public virtual int Update(TEntity entity, params Expression<Func<TEnti...
method UpdateWithout (line 460) | public virtual int UpdateWithout(TEntity entity, params Expression<Fun...
method Update (line 500) | public virtual int Update(TEntity entity, params string[] propertyNames)
method UpdateWithout (line 537) | public virtual int UpdateWithout(TEntity entity, params string[]? prop...
method UpdateWithoutAsync (line 575) | public virtual Task<int> UpdateWithoutAsync(TEntity entity, string[] p...
method UpdateAsync (line 614) | public virtual Task<int> UpdateAsync(TEntity entity, Expression<Func<T...
method UpdateWithoutAsync (line 653) | public virtual Task<int> UpdateWithoutAsync(TEntity entity, Expression...
method UpdateAsync (line 692) | public virtual Task<int> UpdateAsync(TEntity entity, string[] property...
method UpdateAsync (line 731) | public virtual Task<int> UpdateAsync(Expression<Func<TEntity, bool>> w...
method Delete (line 751) | public virtual int Delete(Expression<Func<TEntity, bool>> whereExpress...
method Delete (line 761) | public virtual int Delete(TEntity entity)
method DeleteAsync (line 785) | public virtual Task<int> DeleteAsync(Expression<Func<TEntity, bool>> w...
method DeleteAsync (line 795) | public virtual async Task<int> DeleteAsync(TEntity entity, Cancellatio...
method Execute (line 819) | public virtual int Execute(string sqlStr, object? param = null)
method ExecuteAsync (line 822) | public virtual Task<int> ExecuteAsync(string sqlStr, object? param = n...
method ExecuteScalar (line 825) | public virtual TResult ExecuteScalar<TResult>(string sqlStr, object? p...
method ExecuteScalarAsync (line 829) | public virtual Task<TResult> ExecuteScalarAsync<TResult>(string sqlStr...
method GetColumnName (line 833) | private string GetColumnName(string propertyName)
FILE: src/WeihanLi.Common/Data/RepositoryExtension.cs
class RepositoryExtension (line 5) | public static class RepositoryExtension
method Count (line 7) | public static int Count<TEntity>(this IReadOnlyRepository<TEntity> rep...
method CountAsync (line 9) | public static Task<int> CountAsync<TEntity>(this IReadOnlyRepository<T...
method LongCount (line 12) | public static long LongCount<TEntity>(this IReadOnlyRepository<TEntity...
method LongCountAsync (line 14) | public static Task<long> LongCountAsync<TEntity>(this IReadOnlyReposit...
method Fetch (line 17) | public static TEntity? Fetch<TEntity>(this IReadOnlyRepository<TEntity...
method FetchAsync (line 19) | public static Task<TEntity?> FetchAsync<TEntity>(this IReadOnlyReposit...
method Fetch (line 22) | public static TEntity? Fetch<TEntity, TProperty>(this IReadOnlyReposit...
method FetchAsync (line 24) | public static Task<TEntity?> FetchAsync<TEntity, TProperty>(this IRead...
method GetAll (line 27) | public static List<TEntity> GetAll<TEntity>(this IReadOnlyRepository<T...
method GetAllAsync (line 30) | public static Task<List<TEntity>> GetAllAsync<TEntity>(this IReadOnlyR...
method Top (line 33) | public static List<TEntity> Top<TEntity, TProperty>(this IReadOnlyRepo...
method TopAsync (line 36) | public static Task<List<TEntity>> TopAsync<TEntity, TProperty>(this IR...
method Top (line 39) | public static List<TEntity> Top<TEntity, TProperty>(this IReadOnlyRepo...
method TopAsync (line 42) | public static Task<List<TEntity>> TopAsync<TEntity, TProperty>(this IR...
method UpdateAsync (line 45) | public static Task<int> UpdateAsync<TEntity>(this IRepository<TEntity>...
method UpdateAsync (line 49) | public static Task<int> UpdateAsync<TEntity>(this IRepository<TEntity>...
method UpdateWithoutAsync (line 55) | public static Task<int> UpdateWithoutAsync<TEntity>(this IRepository<T...
method UpdateWithoutAsync (line 59) | public static Task<int> UpdateWithoutAsync<TEntity>(this IRepository<T...
FILE: src/WeihanLi.Common/Data/SqlExpressionParser.cs
class SqlExpressionParser (line 6) | internal static partial class SqlExpressionParser
method ParseWhereExpression (line 8) | internal static SqlParseResult ParseWhereExpression(Expression? exp, I...
method ParseExpression (line 23) | public static string ParseExpression(Expression? exp, IDictionary<stri...
method ParseMemberExpression (line 64) | private static string ParseMemberExpression(MemberExpression? exp, IDi...
method GetExpressionOperatorString (line 90) | private static string GetExpressionOperatorString(BinaryExpression exp)
method ParseConstantExpression (line 113) | private static string ParseConstantExpression(ConstantExpression exp)
method ParseMethodCallExpression (line 130) | private static string ParseMethodCallExpression(MethodCallExpression e...
class SqlParseResult (line 141) | internal class SqlParseResult(string sqlText, IDictionary<string, object...
FILE: src/WeihanLi.Common/Data/SqlExpressionVisitor.cs
class SqlExpressionVisitor (line 6) | public class SqlExpressionVisitor(IDictionary<string, string>? columnMap...
method GetCondition (line 11) | public string GetCondition() => _leaves.StringJoin(" ");
method VisitBinary (line 13) | protected override Expression VisitBinary(BinaryExpression node)
method VisitConstant (line 71) | protected override Expression VisitConstant(ConstantExpression node)
method VisitMember (line 93) | protected override Expression VisitMember(MemberExpression node)
method VisitMethodCall (line 120) | protected override Expression VisitMethodCall(MethodCallExpression node)
FILE: src/WeihanLi.Common/Data/UnitOfWork.cs
class UnitOfWork (line 6) | [CLSCompliant(false)]
method UnitOfWork (line 13) | public UnitOfWork(IDbConnection dbConnection)
method UnitOfWork (line 20) | public UnitOfWork(IDbTransaction dbTransaction)
method Commit (line 25) | public virtual void Commit() => _dbTransaction.Commit();
method CommitAsync (line 27) | public virtual Task CommitAsync(CancellationToken cancellationToken = ...
method Rollback (line 33) | public virtual void Rollback() => _dbTransaction.Rollback();
method RollbackAsync (line 35) | public virtual Task RollbackAsync(CancellationToken cancellationToken ...
method Dispose (line 41) | public void Dispose()
method Dispose (line 47) | protected virtual void Dispose(bool disposing)
FILE: src/WeihanLi.Common/DependencyInjection/DependencyInjectionExtensions.cs
class DependencyInjectionExtensions (line 6) | public static class DependencyInjectionExtensions
method GetServices (line 8) | [RequiresDynamicCode("The native code for this instantiation might not...
method ResolveService (line 26) | public static TService? ResolveService<TService>(this IServiceProvider...
method ResolveRequiredService (line 36) | public static TService ResolveRequiredService<TService>(this IServiceP...
method ResolveServices (line 54) | public static IEnumerable<TService> ResolveServices<TService>(this ISe...
FILE: src/WeihanLi.Common/DependencyInjection/FromServiceAttribute.cs
class FromServiceAttribute (line 3) | [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | Att...
FILE: src/WeihanLi.Common/DependencyInjection/ServiceConstructorAttribute.cs
class ServiceConstructorAttribute (line 3) | [AttributeUsage(AttributeTargets.Constructor, AllowMultiple = false, Inh...
FILE: src/WeihanLi.Common/DependencyInjection/ServiceContainer.cs
type IServiceContainer (line 10) | public interface IServiceContainer : IScope, IServiceProvider
method CreateScope (line 12) | IServiceContainer CreateScope();
class ServiceContainer (line 15) | internal sealed class ServiceContainer : IServiceContainer
class ServiceKey (line 24) | private sealed class ServiceKey(Type serviceType, ServiceDefinition de...
method Equals (line 30) | public bool Equals(ServiceKey? other)
method Equals (line 35) | public override bool Equals(object? obj)
method GetHashCode (line 40) | public override int GetHashCode()
method ServiceContainer (line 49) | public ServiceContainer(IReadOnlyList<ServiceDefinition> serviceDefini...
method ServiceContainer (line 57) | private ServiceContainer(ServiceContainer serviceContainer)
method CreateScope (line 66) | public IServiceContainer CreateScope()
method Dispose (line 73) | public void Dispose()
method EnrichObject (line 128) | [RequiresDynamicCode("The native code for this instantiation might not...
method GetServiceInstance (line 148) | [RequiresDynamicCode("The native code for this instantiation might not...
method GetServiceInstanceInternal (line 153) | [RequiresDynamicCode("The native code for this instantiation might not...
method GetService (line 272) | [RequiresDynamicCode("The native code for this instantiation might not...
FILE: src/WeihanLi.Common/DependencyInjection/ServiceContainerBuilder.cs
type IServiceContainerBuilder (line 5) | public interface IServiceContainerBuilder : IEnumerable<ServiceDefinition>
method Add (line 7) | IServiceContainerBuilder Add(ServiceDefinition item);
method TryAdd (line 9) | IServiceContainerBuilder TryAdd(ServiceDefinition item);
method Build (line 11) | IServiceContainer Build();
class ServiceContainerBuilder (line 14) | public sealed class ServiceContainerBuilder : IServiceContainerBuilder
method Add (line 18) | public IServiceContainerBuilder Add(ServiceDefinition item)
method TryAdd (line 29) | public IServiceContainerBuilder TryAdd(ServiceDefinition item)
method Build (line 39) | public IServiceContainer Build() => new ServiceContainer(_services);
method GetEnumerator (line 41) | public IEnumerator<ServiceDefinition> GetEnumerator() => _services.Get...
method GetEnumerator (line 43) | IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
FILE: src/WeihanLi.Common/DependencyInjection/ServiceContainerBuilderExtensions.cs
class ServiceContainerBuilderExtensions (line 8) | public static partial class ServiceContainerBuilderExtensions
method AddSingleton (line 10) | public static IServiceContainerBuilder AddSingleton<[DynamicallyAccess...
method RegisterAssemblyTypes (line 23) | [RequiresUnreferencedCode("Unreferenced code may be used")]
method RegisterAssemblyTypes (line 34) | [RequiresUnreferencedCode("Unreferenced code may be used")]
method RegisterAssemblyTypes (line 46) | [RequiresUnreferencedCode("Unreferenced code may be used")]
method RegisterAssemblyTypes (line 59) | [RequiresUnreferencedCode("Unreferenced code may be used")]
method RegisterAssemblyTypesAsImplementedInterfaces (line 93) | [RequiresUnreferencedCode("Unreferenced code may be used")]
method RegisterAssemblyTypesAsImplementedInterfaces (line 105) | [RequiresUnreferencedCode("Unreferenced code may be used")]
method RegisterAssemblyTypesAsImplementedInterfaces (line 117) | [RequiresUnreferencedCode("Unreferenced code may be used")]
method RegisterAssemblyTypesAsImplementedInterfaces (line 129) | [RequiresUnreferencedCode("Unreferenced code may be used")]
method RegisterAssemblyTypesAsImplementedInterfaces (line 144) | [RequiresUnreferencedCode("Unreferenced code may be used")]
method RegisterTypeAsImplementedInterfaces (line 184) | public static IServiceContainerBuilder RegisterTypeAsImplementedInterf...
method RegisterTypeAsImplementedInterfaces (line 197) | public static IServiceContainerBuilder RegisterTypeAsImplementedInterf...
method RegisterModule (line 216) | public static IServiceContainerBuilder RegisterModule<TServiceModule>(...
method RegisterAssemblyModules (line 224) | [RequiresUnreferencedCode("Unreferenced code may be used")]
FILE: src/WeihanLi.Common/DependencyInjection/ServiceContainerBuilderExtensions.generated.cs
class ServiceContainerBuilderExtensions (line 4) | public static partial class ServiceContainerBuilderExtensions
method AddSingleton (line 6) | public static IServiceContainerBuilder AddSingleton(this IServiceConta...
method AddSingleton (line 12) | public static IServiceContainerBuilder AddSingleton(this IServiceConta...
method AddSingleton (line 18) | public static IServiceContainerBuilder AddSingleton<TService>(this ISe...
method AddSingleton (line 24) | public static IServiceContainerBuilder AddSingleton<TService>(this ISe...
method AddSingleton (line 30) | public static IServiceContainerBuilder AddSingleton<TService, [Dynamic...
method AddScoped (line 36) | public static IServiceContainerBuilder AddScoped(this IServiceContaine...
method AddScoped (line 42) | public static IServiceContainerBuilder AddScoped(this IServiceContaine...
method AddScoped (line 48) | public static IServiceContainerBuilder AddScoped<[DynamicallyAccessedM...
method AddScoped (line 54) | public static IServiceContainerBuilder AddScoped<[DynamicallyAccessedM...
method AddScoped (line 60) | public static IServiceContainerBuilder AddScoped<TService, [Dynamicall...
method AddTransient (line 66) | public static IServiceContainerBuilder AddTransient(this IServiceConta...
method AddTransient (line 72) | public static IServiceContainerBuilder AddTransient(this IServiceConta...
method AddTransient (line 78) | public static IServiceContainerBuilder AddTransient<TService>(this ISe...
method AddTransient (line 84) | public static IServiceContainerBuilder AddTransient<TService>(this ISe...
method AddTransient (line 90) | public static IServiceContainerBuilder AddTransient<TService, TService...
method TryAddSingleton (line 96) | public static IServiceContainerBuilder TryAddSingleton(this IServiceCo...
method TryAddSingleton (line 102) | public static IServiceContainerBuilder TryAddSingleton(this IServiceCo...
method TryAddSingleton (line 108) | public static IServiceContainerBuilder TryAddSingleton<TService>(this ...
method TryAddSingleton (line 114) | public static IServiceContainerBuilder TryAddSingleton<TService>(this ...
method TryAddSingleton (line 120) | public static IServiceContainerBuilder TryAddSingleton<TService, TServ...
method TryAddScoped (line 126) | public static IServiceContainerBuilder TryAddScoped(this IServiceConta...
method TryAddScoped (line 132) | public static IServiceContainerBuilder TryAddScoped(this IServiceConta...
method TryAddScoped (line 138) | public static IServiceContainerBuilder TryAddScoped<TService>(this ISe...
method TryAddScoped (line 144) | public static IServiceContainerBuilder TryAddScoped<TService>(this ISe...
method TryAddScoped (line 150) | public static IServiceContainerBuilder TryAddScoped<TService, TService...
method TryAddTransient (line 156) | public static IServiceContainerBuilder TryAddTransient(this IServiceCo...
method TryAddTransient (line 162) | public static IServiceContainerBuilder TryAddTransient(this IServiceCo...
method TryAddTransient (line 168) | public static IServiceContainerBuilder TryAddTransient<TService>(this ...
method TryAddTransient (line 174) | public static IServiceContainerBuilder TryAddTransient<TService>(this ...
method TryAddTransient (line 180) | public static IServiceContainerBuilder TryAddTransient<TService, TServ...
FILE: src/WeihanLi.Common/DependencyInjection/ServiceContainerModule.cs
type IServiceContainerModule (line 3) | public interface IServiceContainerModule
method ConfigureServices (line 5) | void ConfigureServices(IServiceContainerBuilder serviceContainerBuilder);
class ServiceContainerModule (line 8) | public abstract class ServiceContainerModule : IServiceContainerModule
method ConfigureServices (line 10) | public abstract void ConfigureServices(IServiceContainerBuilder servic...
FILE: src/WeihanLi.Common/DependencyInjection/ServiceDefinition.cs
class ServiceDefinition (line 5) | public class ServiceDefinition
method GetImplementType (line 17) | public Type GetImplementType()
method ServiceDefinition (line 31) | public ServiceDefinition(object instance, Type serviceType)
method ServiceDefinition (line 38) | public ServiceDefinition(Type serviceType, ServiceLifetime serviceLife...
method ServiceDefinition (line 42) | public ServiceDefinition(Type serviceType, Type? implementType, Servic...
method ServiceDefinition (line 49) | public ServiceDefinition(Type serviceType, Func<IServiceProvider, obje...
method Singleton (line 56) | public static ServiceDefinition Singleton<TService>(Func<IServiceProvi...
method Singleton (line 61) | public static ServiceDefinition Singleton<TService, [DynamicallyAccess...
method Singleton (line 66) | public static ServiceDefinition Singleton<[DynamicallyAccessedMembers(...
method Scoped (line 71) | public static ServiceDefinition Scoped<[DynamicallyAccessedMembers(Dyn...
method Scoped (line 76) | public static ServiceDefinition Scoped<TService, [DynamicallyAccessedM...
method Scoped (line 81) | public static ServiceDefinition Scoped<[DynamicallyAccessedMembers(Dyn...
method Transient (line 86) | public static ServiceDefinition Transient<TService>(Func<IServiceProvi...
method Transient (line 91) | public static ServiceDefinition Transient<[DynamicallyAccessedMembers(...
method Transient (line 96) | public static ServiceDefinition Transient<TService, [DynamicallyAccess...
FILE: src/WeihanLi.Common/DependencyInjection/ServiceLifetime.cs
type ServiceLifetime (line 3) | public enum ServiceLifetime
FILE: src/WeihanLi.Common/DependencyResolver.cs
class DependencyResolver (line 13) | public static class DependencyResolver
method ResolveService (line 18) | public static TService? ResolveService<TService>() => Current.ResolveS...
method ResolveRequiredService (line 20) | public static TService ResolveRequiredService<TService>() => Current.R...
method ResolveServices (line 22) | public static IEnumerable<TService> ResolveServices<TService>() => Cur...
method TryInvoke (line 24) | public static bool TryInvoke<TService>(Action<TService> action) => Cur...
method TryInvokeAsync (line 26) | public static Task<bool> TryInvokeAsync<TService>(Func<TService, Task>...
method SetDependencyResolver (line 28) | public static void SetDependencyResolver(IDependencyResolver dependenc...
method SetDependencyResolver (line 36) | public static void SetDependencyResolver(IServiceContainer serviceCont...
method SetDependencyResolver (line 38) | public static void SetDependencyResolver(IServiceProvider serviceProvi...
method SetDependencyResolver (line 47) | public static void SetDependencyResolver(Func<Type, object?> getServic...
method SetDependencyResolver (line 49) | public static void SetDependencyResolver(Func<Type, object?> getServic...
method SetDependencyResolver (line 51) | public static void SetDependencyResolver(IServiceCollection services) ...
class ServiceProviderDependencyResolver (line 53) | private sealed class ServiceProviderDependencyResolver(ServiceProvider...
method GetService (line 55) | public object? GetService(Type serviceType)
method GetServices (line 60) | [RequiresDynamicCode("The native code for this instantiation might n...
method TryInvokeService (line 67) | public bool TryInvokeService<TService>(Action<TService> action)
method TryInvokeServiceAsync (line 78) | public async Task<bool> TryInvokeServiceAsync<TService>(Func<TServic...
class DefaultDependencyResolver (line 90) | private sealed class DefaultDependencyResolver : IDependencyResolver
method GetService (line 92) | public object? GetService([DynamicallyAccessedMembers((DynamicallyAc...
method GetServices (line 110) | public IEnumerable<object> GetServices(Type serviceType) => Enumerab...
method TryInvokeService (line 112) | public bool TryInvokeService<TService>(Action<TService>? action)
method TryInvokeServiceAsync (line 123) | public async Task<bool> TryInvokeServiceAsync<TService>(Func<TServic...
class DelegateBasedDependencyResolver (line 135) | private sealed class DelegateBasedDependencyResolver(Func<Type, object...
method GetService (line 140) | public object? GetService(Type serviceType)
method GetServices (line 143) | public IEnumerable<object> GetServices(Type serviceType)
method TryInvokeService (line 146) | public bool TryInvokeService<TService>(Action<TService>? action)
method TryInvokeServiceAsync (line 157) | public async Task<bool> TryInvokeServiceAsync<TService>(Func<TServic...
class ServiceContainerDependencyResolver (line 169) | private sealed class ServiceContainerDependencyResolver(IServiceContai...
method GetService (line 171) | public object? GetService(Type serviceType)
method GetServices (line 176) | public IEnumerable<object> GetServices(Type serviceType)
method TryInvokeService (line 181) | public bool TryInvokeService<TService>(Action<TService> action)
method TryInvokeServiceAsync (line 195) | public async Task<bool> TryInvokeServiceAsync<TService>(Func<TServic...
FILE: src/WeihanLi.Common/Event/AckQueue.cs
class AckQueueOptions (line 7) | public sealed class AckQueueOptions
class AckQueue (line 16) | public sealed class AckQueue : DisposableBase
method AckQueue (line 23) | public AckQueue() : this(new()) { }
method AckQueue (line 25) | public AckQueue(AckQueueOptions options)
method EnqueueAsync (line 34) | public Task EnqueueAsync<TEvent>(TEvent @event, EventProperties? prope...
method DequeueAsync (line 57) | public Task<IEvent<TEvent>?> DequeueAsync<TEvent>()
method AckMessageAsync (line 68) | public Task AckMessageAsync(string eventId)
method RequeueUnAckedMessages (line 74) | public void RequeueUnAckedMessages()
method ReadAllAsync (line 89) | public async IAsyncEnumerable<IEvent> ReadAllAsync(
method Dispose (line 104) | protected override void Dispose(bool disposing)
FILE: src/WeihanLi.Common/Event/DelegateEventHandler.cs
class DelegateEventHandler (line 8) | public sealed class DelegateEventHandler<TEvent> : EventHandlerBase<TEvent>
method DelegateEventHandler (line 12) | public DelegateEventHandler(Action<TEvent> action)
method DelegateEventHandler (line 22) | public DelegateEventHandler(Action<TEvent, EventProperties> action)
method DelegateEventHandler (line 32) | public DelegateEventHandler(Func<TEvent, Task> func)
method DelegateEventHandler (line 38) | public DelegateEventHandler(Func<TEvent, EventProperties, Task> func)
method Handle (line 43) | public override Task Handle(TEvent @event, EventProperties properties)
FILE: src/WeihanLi.Common/Event/EventBase.cs
type IEventBase (line 10) | public interface IEventBase
class EventBase (line 23) | public abstract class EventBase : IEventBase
method EventBase (line 31) | protected EventBase()
method EventBase (line 37) | protected EventBase(string eventId)
method EventBase (line 44) | [JsonConstructor]
type IEvent (line 55) | public interface IEvent
type IEvent (line 61) | public interface IEvent<out T>
class EventWrapper (line 67) | public class EventWrapper<T> : IEvent, IEvent<T>
class EventExtensions (line 74) | public static class EventExtensions
method ToEventMsg (line 83) | public static string ToEventMsg<TEvent>(this TEvent @event)
method ToEventRawMsg (line 89) | public static string ToEventRawMsg<TEvent>(this TEvent @event)
method GetEvent (line 95) | private static IEvent GetEvent<TEvent>(this TEvent @event)
method ToEvent (line 121) | public static TEvent ToEvent<TEvent>(this string eventMsg)
method ToEvent (line 127) | public static IEvent ToEvent(this string eventMsg) => ToEvent<IEvent>(...
FILE: src/WeihanLi.Common/Event/EventBus.cs
class EventBus (line 14) | public sealed class EventBus(IEventSubscriptionManager? subscriptionMana...
method PublishAsync (line 20) | public async Task<bool> PublishAsync<TEvent>(TEvent @event, EventPrope...
method SubscribeAsync (line 55) | public Task<bool> SubscribeAsync(Type eventType, Type eventHandlerType...
method SubscribeAsync (line 56) | public Task<bool> SubscribeAsync<TEvent>(IEventHandler<TEvent> eventHa...
method UnSubscribeAsync (line 57) | public Task<bool> UnSubscribeAsync(Type eventType, Type eventHandlerTy...
FILE: src/WeihanLi.Common/Event/EventBusExtensions.cs
type IEventBuilder (line 12) | public interface IEventBuilder
class EventBuilder (line 17) | internal sealed class EventBuilder(IServiceCollection services) : IEvent...
class EventBusExtensions (line 22) | public static class EventBusExtensions
method AddEvents (line 24) | public static IEventBuilder AddEvents(this IServiceCollection services)
method AddEventHandler (line 37) | public static IEventBuilder AddEventHandler<TEvent, [DynamicallyAccess...
method AddEventHandler (line 45) | public static IEventBuilder AddEventHandler<TEvent>(this IEventBuilder...
method RegisterEventHandlers (line 52) | [RequiresUnreferencedCode("Assembly.GetTypes() requires unreferenced c...
method GetEventHandlers (line 88) | public static ICollection<IEventHandler<TEvent>> GetEventHandlers<TEve...
FILE: src/WeihanLi.Common/Event/EventHandler.cs
type IEventHandler (line 9) | public interface IEventHandler
method Handle (line 11) | Task Handle(object eventData, EventProperties properties);
method Handle (line 21) | Task Handle(TEvent @event, EventProperties properties);
type IEventHandler (line 14) | public interface IEventHandler<in TEvent> : IEventHandler
method Handle (line 11) | Task Handle(object eventData, EventProperties properties);
method Handle (line 21) | Task Handle(TEvent @event, EventProperties properties);
class EventHandlerBase (line 24) | public abstract class EventHandlerBase<TEvent> : IEventHandler<TEvent>, ...
method Handle (line 26) | public abstract Task Handle(TEvent @event, EventProperties eventProper...
method Handle (line 28) | public virtual Task Handle(object eventData, EventProperties properties)
FILE: src/WeihanLi.Common/Event/EventHandlerFactory.cs
class DefaultEventHandlerFactory (line 8) | public sealed class DefaultEventHandlerFactory(IEventSubscriptionManager...
method GetHandlers (line 10) | [RequiresUnreferencedCode("Unreferenced code may be used")]
FILE: src/WeihanLi.Common/Event/EventProperties.cs
class EventProperties (line 6) | public sealed class EventProperties : IEventBase
FILE: src/WeihanLi.Common/Event/EventQueueInMemory.cs
class EventQueueInMemory (line 14) | public sealed class EventQueueInMemory : IEventQueue
method GetQueues (line 21) | public ICollection<string> GetQueues() => _eventQueues.Keys;
method GetQueuesAsync (line 23) | public Task<ICollection<string>> GetQueuesAsync() => Task.FromResult(G...
method EnqueueAsync (line 25) | public async Task<bool> EnqueueAsync<TEvent>(string queueName, TEvent ...
method DequeueAsync (line 56) | public Task<IEvent<TEvent>?> DequeueAsync<TEvent>(string queueName)
method ReadAllAsync (line 73) | public async IAsyncEnumerable<IEvent> ReadAllAsync(string queueName,
FILE: src/WeihanLi.Common/Event/EventQueuePublisher.cs
class EventQueuePublisher (line 10) | public class EventQueuePublisher(IEventQueue eventQueue, IOptions<EventQ...
method PublishAsync (line 15) | public virtual Task<bool> PublishAsync<TEvent>(TEvent @event, EventPro...
class EventQueuePublisherOptions (line 39) | public sealed class EventQueuePublisherOptions
FILE: src/WeihanLi.Common/Event/EventStoreInMemory.cs
class EventStoreInMemory (line 9) | public sealed class EventStoreInMemory : IEventStore
method SaveEventsAsync (line 13) | public Task<int> SaveEventsAsync(ICollection<IEvent> events)
method DeleteEvents (line 21) | private int DeleteEvents(ICollection<string> eventIds)
method DeleteEventsAsync (line 26) | public Task<int> DeleteEventsAsync(ICollection<string> eventIds) => Ta...
FILE: src/WeihanLi.Common/Event/EventSubscriptionManager.cs
type IEventSubscriptionManager (line 10) | public interface IEventSubscriptionManager : IEventSubscriber
method GetEventHandlers (line 17) | ICollection<IEventHandler> GetEventHandlers(Type eventType);
class InMemoryEventSubscriptionManager (line 20) | public sealed class InMemoryEventSubscriptionManager(IServiceProvider? s...
method Subscribe (line 26) | [RequiresUnreferencedCode("Calls WeihanLi.Common.Helpers.ActivatorHelp...
method SubscribeAsync (line 33) | public Task<bool> SubscribeAsync(Type eventType, Type eventHandlerType)
method SubscribeAsync (line 38) | public Task<bool> SubscribeAsync<TEvent>(IEventHandler<TEvent> eventHa...
method UnSubscribe (line 44) | public bool UnSubscribe(Type eventType, Type eventHandlerType)
method UnSubscribeAsync (line 55) | public Task<bool> UnSubscribeAsync(Type eventType, Type eventHandlerType)
method GetEventHandlers (line 60) | public ICollection<IEventHandler> GetEventHandlers(Type eventType)
class DependencyInjectionEventSubscriptionManager (line 66) | public sealed class DependencyInjectionEventSubscriptionManager(IService...
method SubscribeAsync (line 69) | public Task<bool> SubscribeAsync(Type eventType, Type eventHandlerType...
method SubscribeAsync (line 70) | public Task<bool> SubscribeAsync<TEvent>(IEventHandler<TEvent> eventHa...
method UnSubscribeAsync (line 71) | public Task<bool> UnSubscribeAsync(Type eventType, Type eventHandlerTy...
method GetEventHandlers (line 72) | [RequiresUnreferencedCode("Unreferenced code may be used")]
FILE: src/WeihanLi.Common/Event/IEventBus.cs
type IEventBus (line 6) | public interface IEventBus : IEventPublisher, IEventSubscriber;
FILE: src/WeihanLi.Common/Event/IEventHandlerFactory.cs
type IEventHandlerFactory (line 6) | public interface IEventHandlerFactory
method GetHandlers (line 8) | ICollection<IEventHandler> GetHandlers(Type eventType);
class EventHandlerFactoryExtensions (line 11) | public static class EventHandlerFactoryExtensions
method GetHandlers (line 13) | public static ICollection<IEventHandler<TEvent>> GetHandlers<TEvent>(t...
FILE: src/WeihanLi.Common/Event/IEventPublisher.cs
type IEventPublisher (line 6) | public interface IEventPublisher
method PublishAsync (line 15) | Task<bool> PublishAsync<TEvent>(TEvent @event, EventProperties? proper...
FILE: src/WeihanLi.Common/Event/IEventQueue.cs
type IEventQueue (line 8) | public interface IEventQueue
method GetQueuesAsync (line 10) | Task<ICollection<string>> GetQueuesAsync();
method EnqueueAsync (line 11) | Task<bool> EnqueueAsync<TEvent>(string queueName, TEvent @event, Event...
method DequeueAsync (line 12) | Task<IEvent<TEvent>?> DequeueAsync<TEvent>(string queueName);
method ReadAllAsync (line 13) | IAsyncEnumerable<IEvent> ReadAllAsync(string queueName, CancellationTo...
class EventQueueExtensions (line 16) | public static class EventQueueExtensions
method EnqueueAsync (line 20) | public static Task<bool> EnqueueAsync<TEvent>(this IEventQueue eventQu...
method ReadEventsAsync (line 26) | public static async IAsyncEnumerable<IEvent<TEvent>> ReadEventsAsync<T...
FILE: src/WeihanLi.Common/Event/IEventStore.cs
type IEventStore (line 6) | public interface IEventStore
method SaveEventsAsync (line 8) | Task<int> SaveEventsAsync(ICollection<IEvent> events);
method DeleteEventsAsync (line 9) | Task<int> DeleteEventsAsync(ICollection<string> eventIds);
FILE: src/WeihanLi.Common/Event/IEventSubscriber.cs
type IEventSubscriber (line 6) | public interface IEventSubscriber
method SubscribeAsync (line 14) | Task<bool> SubscribeAsync(Type eventType, Type eventHandlerType);
method SubscribeAsync (line 22) | Task<bool> SubscribeAsync<TEvent>(IEventHandler<TEvent> eventHandler);
method UnSubscribeAsync (line 30) | Task<bool> UnSubscribeAsync(Type eventType, Type eventHandlerType);
class EventSubscriberExtensions (line 33) | public static class EventSubscriberExtensions
method SubscribeAsync (line 41) | public static Task<bool> SubscribeAsync<TEvent, TEventHandler>(this IE...
method UnSubscribeAsync (line 53) | public static Task<bool> UnSubscribeAsync<TEvent, TEventHandler>(this ...
FILE: src/WeihanLi.Common/Extensions/CollectionExtension.cs
class CollectionExtension (line 13) | public static class CollectionExtension
method ToDictionary (line 20) | public static IDictionary<string, string?> ToDictionary(this NameValue...
method ToQueryString (line 39) | public static string ToQueryString(this NameValueCollection? source)
method AddIf (line 75) | public static bool AddIf<T>(this ICollection<T> @this, Func<T, bool> p...
method AddIfNotContains (line 95) | public static bool AddIfNotContains<T>(this ICollection<T> @this, T va...
method AddRange (line 114) | public static void AddRange<T>(this ICollection<T> @this, params T[] v...
method AddRangeIf (line 134) | public static void AddRangeIf<T>(this ICollection<T> @this, Func<T, bo...
method AddRangeIfNotContains (line 152) | public static void AddRangeIfNotContains<T>(this ICollection<T> @this,...
method ContainsAll (line 171) | public static bool ContainsAll<T>(this ICollection<T> @this, params T[...
method ContainsAny (line 183) | public static bool ContainsAny<T>(this ICollection<T> @this, params T[...
method IsNullOrEmpty (line 194) | public static bool IsNullOrEmpty<T>([NotNullWhen(false)] this ICollect...
method HasValue (line 205) | public static bool HasValue<T>([NotNullWhen(true)] this ICollection<T>...
method RemoveWhere (line 216) | public static void RemoveWhere<T>(this IList<T> @this, Func<T, bool> p...
method GetRandomList (line 229) | public static IEnumerable<T> GetRandomList<T>(this IList<T> list)
method Partitions (line 252) | public static IEnumerable<T[][]> Partitions<T>(this T[] array, int batch)
FILE: src/WeihanLi.Common/Extensions/CompressionExtension.cs
class CompressionExtension (line 10) | public static class CompressionExtension
method CompressGZip (line 17) | public static byte[] CompressGZip(this string @this)
method CompressGZip (line 26) | public static byte[] CompressGZip(this string @this, Encoding encoding...
method CompressGZip (line 33) | public static byte[] CompressGZip(this byte[] bytes)
method CompressGZipAsync (line 43) | public static async Task<byte[]> CompressGZipAsync(this byte[] bytes)
method CompressGZip (line 53) | public static byte[] CompressGZip(this Stream stream)
method CompressGZipAsync (line 63) | public static async Task<byte[]> CompressGZipAsync(this Stream stream)
method DecompressGZip (line 78) | public static byte[] DecompressGZip(this byte[] @this)
method DecompressGZipAsync (line 84) | public static async Task<byte[]> DecompressGZipAsync(this byte[] @this)
method DecompressGZip (line 90) | public static byte[] DecompressGZip(this Stream stream)
method DecompressGZipAsync (line 100) | public static async Task<byte[]> DecompressGZipAsync(this Stream stream)
method CompressGZipString (line 110) | public static string CompressGZipString(this byte[] bytes) => bytes.Co...
method CompressGZipString (line 112) | public static string CompressGZipString(this byte[] bytes, Encoding en...
method DecompressGZipString (line 122) | public static string DecompressGZipString(this byte[] bytes) =>
method DecompressGZipString (line 125) | public static string DecompressGZipString(this byte[] bytes, Encoding ...
method CreateGZip (line 131) | public static void CreateGZip(this FileInfo @this)
method CreateGZip (line 144) | public static void CreateGZip(this FileInfo @this, string destination)
method CreateGZip (line 157) | public static void CreateGZip(this FileInfo @this, FileInfo destination)
method ExtractGZipToDirectory (line 170) | public static void ExtractGZipToDirectory(this FileInfo @this)
method ExtractGZipToDirectory (line 186) | public static void ExtractGZipToDirectory(this FileInfo @this, string ...
method ExtractGZipToDirectory (line 200) | public static void ExtractGZipToDirectory(this FileInfo @this, FileInf...
method OpenZipFile (line 215) | public static ZipArchive OpenZipFile(this FileInfo @this, ZipArchiveMo...
method OpenZipFile (line 236) | public static ZipArchive OpenZipFile(this FileInfo @this, ZipArchiveMo...
method OpenReadZipFile (line 250) | public static ZipArchive OpenReadZipFile(this FileInfo @this)
method ExtractZipFileToDirectory (line 264) | public static void ExtractZipFileToDirectory(this FileInfo @this, stri...
method ExtractZipFileToDirectory (line 283) | public static void ExtractZipFileToDirectory(this FileInfo @this, stri...
method ExtractZipFileToDirectory (line 291) | public static void ExtractZipFileToDirectory(this FileInfo @this, Dire...
method ExtractZipFileToDirectory (line 308) | public static void ExtractZipFileToDirectory(this FileInfo @this, Dire...
method CreateZipFile (line 323) | public static void CreateZipFile(this DirectoryInfo @this, string dest...
method CreateZipFile (line 347) | public static void CreateZipFile(this DirectoryInfo @this, string dest...
method CreateZipFile (line 377) | public static void CreateZipFile(this DirectoryInfo @this, string dest...
method CreateZipFile (line 392) | public static void CreateZipFile(this DirectoryInfo @this, FileInfo de...
method CreateZipFile (line 416) | public static void CreateZipFile(this DirectoryInfo @this, FileInfo de...
method CreateZipFile (line 450) | public static void CreateZipFile(this DirectoryInfo @this, FileInfo de...
FILE: src/WeihanLi.Common/Extensions/ConfigurationExtension.cs
class ConfigurationExtension (line 12) | public static class ConfigurationExtension
method ReplacePlaceholders (line 27) | public static IConfiguration ReplacePlaceholders(this IConfiguration c...
class InvalidConfigurationPlaceholderException (line 70) | private sealed class InvalidConfigurationPlaceholderException(string p...
method GetRequiredAppSetting (line 84) | public static string GetRequiredAppSetting(this IConfiguration configu...
method GetAppSetting (line 97) | public static string? GetAppSetting(this IConfiguration configuration,...
method GetRequiredConnectionString (line 109) | public static string GetRequiredConnectionString(this IConfiguration c...
method GetAppSetting (line 123) | public static string GetAppSetting(this IConfiguration configuration, ...
method GetAppSetting (line 135) | [RequiresUnreferencedCode("Generic TypeConverters may require the gene...
method GetAppSetting (line 149) | [RequiresUnreferencedCode("Generic TypeConverters may require the gene...
method GetAppSetting (line 163) | [RequiresUnreferencedCode("Generic TypeConverters may require the gene...
method TryGetFeatureFlagValue (line 185) | public static bool TryGetFeatureFlagValue(this IConfiguration configur...
method IsFeatureEnabled (line 203) | public static bool IsFeatureEnabled(this IConfiguration configuration,...
FILE: src/WeihanLi.Common/Extensions/CoreExtension.cs
class CoreExtension (line 15) | public static class CoreExtension
method IfTrue (line 24) | public static void IfTrue(this bool @this, Action? action)
method IfFalse (line 37) | public static void IfFalse(this bool @this, Action? action)
method ToString (line 52) | public static string ToString(this bool @this, string trueValue, strin...
method Max (line 67) | public static byte Max(this byte val1, byte val2)
method Min (line 78) | public static byte Min(this byte val1, byte val2)
method ToBase64String (line 93) | public static string ToBase64String(this byte[] inArray)
method ToBase64String (line 105) | public static string ToBase64String(this byte[] inArray, Base64Formatt...
method ToBase64String (line 119) | public static string ToBase64String(this byte[] inArray, int offset, i...
method ToBase64String (line 134) | public static string ToBase64String(this byte[] inArray, int offset, i...
method ToHexString (line 140) | public static string ToHexString(this ReadOnlySpan<byte> bytes, bool i...
method ToHexString (line 150) | public static string ToHexString(this byte[] bytes, bool isLowerCase =...
method Resize (line 168) | public static byte[] Resize(this byte[] @this, int newSize)
method ToMemoryStream (line 179) | public static MemoryStream ToMemoryStream(this byte[] byteArray)
method GetString (line 184) | public static string GetString(this byte[]? byteArray)
method GetString (line 187) | public static string GetString(this byte[] byteArray, Encoding encodin...
method Repeat (line 199) | public static string Repeat(this char @this, int repeatCount)
method GetNumericValue (line 209) | public static double GetNumericValue(this char c)
method GetUnicodeCategory (line 219) | public static UnicodeCategory GetUnicodeCategory(this char c)
method IsControl (line 229) | public static bool IsControl(this char c)
method IsDigit (line 239) | public static bool IsDigit(this char c)
method IsLetter (line 249) | public static bool IsLetter(this char c)
method IsLetterOrDigit (line 259) | public static bool IsLetterOrDigit(this char c)
method IsLower (line 269) | public static bool IsLower(this char c)
method IsUpper (line 279) | public static bool IsUpper(this char c)
method IsNumber (line 289) | public static bool IsNumber(this char c)
method IsSeparator (line 299) | public static bool IsSeparator(this char c)
method IsSymbol (line 309) | public static bool IsSymbol(this char c)
method IsWhiteSpace (line 319) | public static bool IsWhiteSpace(this char c)
method ToLower (line 334) | public static char ToLower(this char c, CultureInfo culture)
method ToLower (line 346) | public static char ToLower(this char c)
method ToLowerInvariant (line 360) | public static char ToLowerInvariant(this char c)
method ToUpper (line 375) | public static char ToUpper(this char c, CultureInfo culture)
method ToUpper (line 388) | public static char ToUpper(this char c)
method ToUpperInvariant (line 402) | public static char ToUpperInvariant(this char c)
method Age (line 416) | public static int Age(this DateTime @this)
method IsDateEqual (line 433) | public static bool IsDateEqual(this DateTime date, DateTime dateToComp...
method IsToday (line 440) | public static bool IsToday(this DateTime @this)
method IsWeekDay (line 450) | public static bool IsWeekDay(this DateTime @this)
method IsWeekendDay (line 460) | public static bool IsWeekendDay(this DateTime @this)
method StartOfDay (line 471) | public static DateTime StartOfDay(this DateTime @this)
method StartOfMonth (line 482) | public static DateTime StartOfMonth(this DateTime @this)
method StartOfWeek (line 493) | public static DateTime StartOfWeek(this DateTime dt, DayOfWeek startDa...
method StartOfYear (line 516) | public static DateTime StartOfYear(this DateTime @this)
method ToEpochTimeSpan (line 526) | public static TimeSpan ToEpochTimeSpan(this DateTime @this) => @this.T...
method InRange (line 535) | public static bool InRange(this DateTime @this, DateTime minValue, Dat...
method ConvertTime (line 546) | public static DateTime ConvertTime(this DateTime dateTime, TimeZoneInf...
method ConvertTime (line 560) | public static DateTime ConvertTime(this DateTime dateTime, TimeZoneInf...
method ConvertTimeFromUtc (line 573) | public static DateTime ConvertTimeFromUtc(this DateTime dateTime, Time...
method ConvertTimeToUtc (line 586) | public static DateTime ConvertTimeToUtc(this DateTime dateTime)
method ConvertTimeToUtc (line 600) | public static DateTime ConvertTimeToUtc(this DateTime dateTime, TimeZo...
method ToDateString (line 611) | public static string ToDateString(this DateTime @this, string format =...
method ToTimeString (line 622) | public static string ToTimeString(this DateTime @this, string format =...
method Ceiling (line 640) | public static int Ceiling(this double a) => Convert.ToInt32(Math.Ceili...
method Log (line 650) | public static double Log(this double d)
method Log10 (line 663) | public static double Log10(this double d)
method In (line 678) | public static bool In(this Enum @this, params Enum[] values)
method GetDescription (line 688) | public static string GetDescription(this Enum value)
method IsNullOrEmpty (line 703) | public static bool IsNullOrEmpty(this Guid? @this)
method IsNotNullOrEmpty (line 711) | public static bool IsNotNullOrEmpty(this Guid? @this)
method IsEmpty (line 719) | public static bool IsEmpty(this Guid @this)
method IsNotEmpty (line 727) | public static bool IsNotEmpty(this Guid @this)
method FactorOf (line 742) | public static bool FactorOf(this int @this, int factorNumber)
method IsEven (line 752) | public static bool IsEven(this int @this)
method IsOdd (line 762) | public static bool IsOdd(this int @this)
method IsMultipleOf (line 773) | public static bool IsMultipleOf(this int @this, int factor)
method IsPrime (line 783) | public static bool IsPrime(this int @this)
method GetBytes (line 812) | public static byte[] GetBytes(this int value)
method EnsureSuccessExitCode (line 824) | [System.Diagnostics.DebuggerStepThrough]
method AsOrDefault (line 843) | public static T? AsOrDefault<T>(this object? @this)
method AsOrDefault (line 866) | public static T AsOrDefault<T>(this object? @this, T defaultValue)
method AsOrDefault (line 889) | public static T AsOrDefault<T>(this object? @this, Func<T> defaultValu...
method To (line 911) | [RequiresUnreferencedCode("Generic TypeConverters may require the gene...
method To (line 949) | [RequiresUnreferencedCode("Generic TypeConverters may require the gene...
method ToOrDefault (line 987) | [RequiresUnreferencedCode("Generic TypeConverters may require the gene...
method ToOrDefault (line 1007) | [RequiresUnreferencedCode("Generic TypeConverters may require the gene...
method ToOrDefault (line 1019) | [RequiresUnreferencedCode("Generic TypeConverters may require the gene...
method ToOrDefault (line 1039) | [RequiresUnreferencedCode("Generic TypeConverters may require the gene...
method ToOrDefault (line 1052) | [RequiresUnreferencedCode("Generic TypeConverters may require the gene...
method To (line 1066) | public static T To<T>(this ReadOnlySpan<char> @this, IFormatProvider? ...
method ToOrDefault (line 1080) | public static T? ToOrDefault<T>(this ReadOnlySpan<char> @this,
method Chain (line 1096) | public static T Chain<T>(this T @this, Action<T>? action)
method GetValueOrDefault (line 1111) | public static TResult? GetValueOrDefault<T, TResult>(this T @this, Fun...
method GetValueOrDefault (line 1132) | public static TResult GetValueOrDefault<T, TResult>(this T @this, Func...
method Try (line 1151) | public static TResult Try<TType, TResult>(this TType @this, Func<TType...
method Try (line 1170) | public static TResult Try<TType, TResult>(this TType @this, Func<TType...
method Try (line 1189) | public static bool Try<TType, TResult>(this TType @this, Func<TType, T...
method Try (line 1211) | public static bool Try<TType, TResult>(this TType @this, Func<TType, T...
method Try (line 1233) | public static bool Try<TType, TResult>(this TType @this, Func<TType, T...
method Try (line 1252) | public static bool Try<TType>(this TType @this, Action<TType> tryAction)
method Try (line 1271) | public static bool Try<TType>(this TType @this, Action<TType> tryActio...
method InRange (line 1293) | public static bool InRange<T>(this T @this, T minValue, T maxValue) wh...
method IsDefault (line 1304) | public static bool IsDefault<T>(this T source)
method ParseParamDictionary (line 1312) | public static IDictionary<string, object?> ParseParamDictionary(this o...
method OneOf (line 1358) | public static T OneOf<T>(this Random @this, params T[] values)
method CoinToss (line 1368) | public static bool CoinToss(this Random @this)
method IsNullOrEmpty (line 1382) | public static bool IsNullOrEmpty([NotNullWhen(false)] this string? @th...
method IsNotNullOrEmpty (line 1389) | public static bool IsNotNullOrEmpty([NotNullWhen(true)] this string? @...
method IsNullOrWhiteSpace (line 1396) | public static bool IsNullOrWhiteSpace([NotNullWhen(false)] this string...
method IsNotNullOrWhiteSpace (line 1403) | public static bool IsNotNullOrWhiteSpace([NotNullWhen(true)] this stri...
method Join (line 1417) | public static string Join<T>(this string separator, IEnumerable<T> val...
method IsMatch (line 1425) | public static bool IsMatch(this string input, string pattern) => Regex...
method IsMatch (line 1435) | public static bool IsMatch(this string input, string pattern, RegexOpt...
method Concatenate (line 1440) | public static string Concatenate(this IEnumerable<string> stringCollec...
method Concatenate (line 1450) | public static string Concatenate<T>(this IEnumerable<T> source, Func<T...
method Contains (line 1461) | public static bool Contains(this string @this, string value) => Guard....
method Contains (line 1470) | public static bool Contains(this string @this, string value, StringCom...
method Extract (line 1478) | public static string Extract(this string @this, Func<char, bool> predi...
method RemoveWhere (line 1486) | public static string RemoveWhere(this string @this, Func<char, bool> p...
method FormatWith (line 1498) | public static string FormatWith(this string @this, params object?[] va...
method IsLike (line 1506) | public static bool IsLike(this string @this, string pattern)
method SafeSubstring (line 1528) | public static string SafeSubstring(this string @this, int startIndex)
method SafeSubstring (line 1544) | public static string SafeSubstring(this string str, int startIndex, in...
method Sub (line 1560) | public static string Sub(this string @this, int startIndex)
method Repeat (line 1580) | public static string Repeat(this string @this, int repeatCount)
method Reverse (line 1602) | public static string Reverse(this string? @this)
method Split (line 1627) | public static string[] Split(this string @this, string separator, Stri...
method ToBytes (line 1635) | public static byte[] ToBytes(this string @this) => Encoding.UTF8.GetBy...
method ToBytes (line 1643) | public static byte[] ToBytes(this string @this, Encoding encoding) => ...
method HexStringToBytes (line 1645) | public static byte[] HexStringToBytes(this string hexString)
method GetBytes (line 1664) | public static byte[] GetBytes(this string str) => Guard.NotNull(str, n...
method GetBytes (line 1666) | public static byte[] GetBytes(this string str, Encoding? encoding) => ...
method ToBoolean (line 1668) | public static bool ToBoolean(this string? value, bool defaultValue = f...
method ToEnum (line 1685) | public static T ToEnum<T>(this string @this) => (T)Enum.Parse(typeof(T...
method ToTitleCase (line 1692) | public static string ToTitleCase(this string @this) => new CultureInfo...
method ToTitleCase (line 1700) | public static string ToTitleCase(this string @this, CultureInfo cultur...
method Truncate (line 1708) | public static string Truncate(this string @this, int maxLength) => Gua...
method Truncate (line 1717) | public static string Truncate(this string @this, int maxLength, string...
method EqualsIgnoreCase (line 1732) | public static bool EqualsIgnoreCase(this string? s1, string? s2)
method Substring (line 1743) | public static string Substring(this StringBuilder @this, int startIndex)
method Substring (line 1753) | public static string Substring(this StringBuilder @this, int startInde...
method AppendJoin (line 1763) | public static StringBuilder AppendJoin<T>(this StringBuilder @this, st...
method AppendLineJoin (line 1775) | public static StringBuilder AppendLineJoin<T>(this StringBuilder @this...
method AppendIf (line 1789) | public static StringBuilder AppendIf(this StringBuilder builder, strin...
method AppendIf (line 1806) | public static StringBuilder AppendIf(this StringBuilder builder, Func<...
method AppendLineIf (line 1823) | public static StringBuilder AppendLineIf(this StringBuilder builder, s...
method AppendLineIf (line 1841) | public static StringBuilder AppendLineIf(this StringBuilder builder, F...
method Ago (line 1861) | public static DateTime Ago(this TimeSpan @this) => DateTime.Now.Subtra...
method FromNow (line 1868) | public static DateTime FromNow(this TimeSpan @this) => DateTime.Now.Ad...
method UtcAgo (line 1876) | public static DateTime UtcAgo(this TimeSpan @this) => DateTime.UtcNow....
method UtcFromNow (line 1883) | public static DateTime UtcFromNow(this TimeSpan @this) => DateTime.Utc...
method CreateInstance (line 1896) | public static T? CreateInstance<[DynamicallyAccessedMembers(Dynamicall...
method HasEmptyConstructor (line 1903) | public static bool HasEmptyConstructor([DynamicallyAccessedMembers(Dyn...
method IsNullableType (line 1906) | public static bool IsNullableType(this Type type)
method GetDefaultValue (line 1919) | public static object? GetDefaultValue(this Type type)
method Unwrap (line 1932) | public static Type Unwrap(this Type type)
method GetUnderlyingType (line 1940) | public static Type? GetUnderlyingType(this Type type)
FILE: src/WeihanLi.Common/Extensions/CronExtension.cs
class CronExtension (line 7) | public static class CronExtension
method GetNextOccurrence (line 14) | public static DateTimeOffset? GetNextOccurrence(this CronExpression? e...
method GetNextOccurrence (line 25) | public static DateTimeOffset? GetNextOccurrence(this CronExpression? e...
method GetNextOccurrences (line 36) | public static IEnumerable<DateTimeOffset> GetNextOccurrences(this Cron...
method GetNextOccurrences (line 50) | public static IEnumerable<DateTimeOffset> GetNextOccurrences(this Cron...
FILE: src/WeihanLi.Common/Extensions/DataExtension.cs
class DataExtension (line 15) | public static partial class DataExtension
class DbParameterReadOnlyCollection (line 17) | private sealed class DbParameterReadOnlyCollection(DbParameterCollecti...
method GetEnumerator (line 23) | public IEnumerator<DbParameter> GetEnumerator()
method GetEnumerator (line 28) | IEnumerator IEnumerable.GetEnumerator()
method GetReadOnlyCollection (line 34) | private static DbParameterReadOnlyCollection GetReadOnlyCollection(thi...
method ToDataTable (line 43) | public static DataTable ToDataTable<[DynamicallyAccessedMembers(Dynami...
method GetValueFromDbValue (line 63) | private static object? GetValueFromDbValue(this object? obj)
method ToEntities (line 78) | [RequiresUnreferencedCode("Generic TypeConverters may require the gene...
method ToExpandoObjects (line 105) | public static IEnumerable<dynamic> ToExpandoObjects(this DataTable @this)
method ColumnToList (line 128) | [RequiresUnreferencedCode("Generic TypeConverters may require the gene...
method ToEntity (line 151) | public static T ToEntity<[DynamicallyAccessedMembers(DynamicallyAccess...
method ToExpandoObject (line 187) | public static dynamic ToExpandoObject(this DataRow @this)
method ToDataTable (line 209) | [RequiresUnreferencedCode("Members from types used in the expression c...
method ToEntities (line 223) | [RequiresUnreferencedCode("Generic TypeConverters may require the gene...
method ToEntity (line 250) | [RequiresUnreferencedCode("Generic TypeConverters may require the gene...
method ToExpandoObject (line 315) | public static dynamic ToExpandoObject(this IDataReader @this, bool had...
method ToExpandoObjects (line 343) | public static IEnumerable<dynamic> ToExpandoObjects(this IDataReader @...
method EnsureOpen (line 373) | public static void EnsureOpen(this IDbConnection connection)
method IsConnectionOpen (line 384) | public static bool IsConnectionOpen(this IDbConnection connection)
method EnsureOpenAsync (line 397) | public static async Task EnsureOpenAsync(this DbConnection conn)
method ExecuteExpandoObject (line 414) | public static dynamic ExecuteExpandoObject(this DbCommand @this)
method ExecuteExpandoObjects (line 428) | public static IEnumerable<dynamic> ExecuteExpandoObjects(this DbComman...
method ExecuteDataTable (line 441) | public static T ExecuteDataTable<T>(this DbCommand @this, Func<DataTab...
method ExecuteDataTableAsync (line 451) | public static async Task<T> ExecuteDataTableAsync<T>(this DbCommand @t...
method ExecuteScalarTo (line 464) | [RequiresUnreferencedCode("Generic TypeConverters may require the gene...
method ExecuteScalarToAsync (line 474) | [RequiresUnreferencedCode("Generic TypeConverters may require the gene...
method ExecuteScalarToOrDefault (line 483) | [RequiresUnreferencedCode("Generic TypeConverters may require the gene...
method ExecuteScalarToOrDefaultAsync (line 493) | [RequiresUnreferencedCode("Generic TypeConverters may require the gene...
method ExecuteScalarTo (line 503) | [RequiresUnreferencedCode("Generic TypeConverters may require the gene...
method GetDbCommand (line 509) | private static DbCommand GetDbCommand(this DbConnection conn, string c...
method ContainsParam (line 534) | public static bool ContainsParam(this DbParameterCollection @this, str...
method AttachDbParameters (line 542) | public static void AttachDbParameters(this DbCommand command, object? ...
method GetParameterName (line 577) | private static string GetParameterName(string originName)
method ToDbType (line 620) | public static DbType ToDbType(this Type type)
FILE: src/WeihanLi.Common/Extensions/DbCommandExtension.generated.cs
class DataExtension (line 8) | public static partial class DataExtension
method Select (line 11) | public static IEnumerable<dynamic> Select(this DbCommand command)
method SelectAsync (line 19) | public static async Task<IEnumerable<dynamic>> SelectAsync(this DbComm...
method Select (line 32) | public static IEnumerable<T> Select<T>(this DbCommand command)
method SelectAsync (line 45) | public static async Task<IEnumerable<T>> SelectAsync<T>(this DbCommand...
method Fetch (line 59) | public static dynamic Fetch(this DbCommand command)
method FetchAsync (line 67) | public static async Task<dynamic> FetchAsync(this DbCommand command, C...
method Fetch (line 76) | public static T? Fetch<T>(this DbCommand command)
method FetchAsync (line 84) | public static async Task<T?> FetchAsync<T>(this DbCommand command, Can...
method ExecuteDataTable (line 93) | public static DataTable ExecuteDataTable(this DbCommand command)
method ExecuteDataTableAsync (line 101) | public static async Task<DataTable> ExecuteDataTableAsync(this DbComma...
FILE: src/WeihanLi.Common/Extensions/DbConnectionExtension.generated.cs
class DataExtension (line 6) | public static partial class DataExtension
method Execute (line 8) | public static int Execute(this DbConnection conn, string cmdText, int ...
method Execute (line 10) | public static int Execute(this DbConnection conn, string cmdText, obje...
method Execute (line 12) | public static int Execute(this DbConnection conn, string cmdText, obje...
method Execute (line 14) | public static int Execute(this DbConnection conn, string cmdText, Comm...
method Execute (line 16) | public static int Execute(this DbConnection conn, string cmdText, Comm...
method ExecuteAsync (line 30) | public static Task<int> ExecuteAsync(this DbConnection conn, string cm...
method ExecuteAsync (line 32) | public static Task<int> ExecuteAsync(this DbConnection conn, string cm...
method ExecuteAsync (line 34) | public static Task<int> ExecuteAsync(this DbConnection conn, string cm...
method ExecuteAsync (line 36) | public static Task<int> ExecuteAsync(this DbConnection conn, string cm...
method ExecuteAsync (line 38) | public static async Task<int> ExecuteAsync(this DbConnection conn, str...
method ExecuteScalar (line 51) | public static object? ExecuteScalar(this DbConnection conn, string cmd...
method ExecuteScalar (line 53) | public static object? ExecuteScalar(this DbConnection conn, string cmd...
method ExecuteScalar (line 55) | public static object? ExecuteScalar(this DbConnection conn, string cmd...
method ExecuteScalar (line 57) | public static object? ExecuteScalar(this DbConnection conn, string cmd...
method ExecuteScalar (line 59) | public static object? ExecuteScalar(this DbConnection conn, string cmd...
method ExecuteScalarAsync (line 73) | public static Task<object?> ExecuteScalarAsync(this DbConnection conn,...
method ExecuteScalarAsync (line 75) | public static Task<object?> ExecuteScalarAsync(this DbConnection conn,...
method ExecuteScalarAsync (line 77) | public static Task<object?> ExecuteScalarAsync(this DbConnection conn,...
method ExecuteScalarAsync (line 79) | public static Task<object?> ExecuteScalarAsync(this DbConnection conn,...
method ExecuteScalarAsync (line 81) | public static async Task<object?> ExecuteScalarAsync(this DbConnection...
method Fetch (line 94) | public static dynamic Fetch(this DbConnection conn, string cmdText, in...
method Fetch (line 96) | public static dynamic Fetch(this DbConnection conn, string cmdText, ob...
method Fetch (line 98) | public static dynamic Fetch(this DbConnection conn, string cmdText, ob...
method Fetch (line 100) | public static dynamic Fetch(this DbConnection conn, string cmdText, Co...
method Fetch (line 102) | public static dynamic Fetch(this DbConnection conn, string cmdText, Co...
method FetchAsync (line 116) | public static Task<dynamic> FetchAsync(this DbConnection conn, string ...
method FetchAsync (line 118) | public static Task<dynamic> FetchAsync(this DbConnection conn, string ...
method FetchAsync (line 120) | public static Task<dynamic> FetchAsync(this DbConnection conn, string ...
method FetchAsync (line 122) | public static Task<dynamic> FetchAsync(this DbConnection conn, string ...
method FetchAsync (line 124) | public static async Task<dynamic> FetchAsync(this DbConnection conn, s...
method ExecuteDataTable (line 137) | public static DataTable ExecuteDataTable(this DbConnection conn, strin...
method ExecuteDataTable (line 139) | public static DataTable ExecuteDataTable(this DbConnection conn, strin...
method ExecuteDataTable (line 141) | public static DataTable ExecuteDataTable(this DbConnection conn, strin...
method ExecuteDataTable (line 143) | public static DataTable ExecuteDataTable(this DbConnection conn, strin...
method ExecuteDataTable (line 145) | public static DataTable ExecuteDataTable(this DbConnection conn, strin...
method ExecuteDataTableAsync (line 159) | public static Task<DataTable> ExecuteDataTableAsync(this DbConnection ...
method ExecuteDataTableAsync (line 161) | public static Task<DataTable> ExecuteDataTableAsync(this DbConnection ...
method ExecuteDataTableAsync (line 163) | public static Task<DataTable> ExecuteDataTableAsync(this DbConnection ...
method ExecuteDataTableAsync (line 165) | public static Task<DataTable> ExecuteDataTableAsync(this DbConnection ...
method ExecuteDataTableAsync (line 167) | public static async Task<DataTable> ExecuteDataTableAsync(this DbConne...
method Fetch (line 181) | public static T? Fetch<T>(this DbConnection conn, string cmdText, int ...
method Fetch (line 183) | public static T? Fetch<T>(this DbConnection conn, string cmdText, obje...
method Fetch (line 185) | public static T? Fetch<T>(this DbConnection conn, string cmdText, Comm...
method Fetch (line 187) | public static T? Fetch<T>(this DbConnection conn, string cmdText, obje...
method Fetch (line 189) | public static T? Fetch<T>(this DbConnection conn, string cmdText, Comm...
method FetchAsync (line 205) | public static Task<T?> FetchAsync<T>(this DbConnection conn, string cm...
method FetchAsync (line 207) | public static Task<T?> FetchAsync<T>(this DbConnection conn, string cm...
method FetchAsync (line 209) | public static Task<T?> FetchAsync<T>(this DbConnection conn, string cm...
method FetchAsync (line 211) | public static Task<T?> FetchAsync<T>(this DbConnection conn, string cm...
method FetchAsync (line 213) | public static Task<T?> FetchAsync<T>(this DbConnection conn, string cm...
method FetchAsync (line 215) | public static async Task<T?> FetchAsync<T>(this DbConnection conn, str...
method Select (line 230) | public static IEnumerable<T> Select<T>(this DbConnection conn, string ...
method Select (line 232) | public static IEnumerable<T> Select<T>(this DbConnection conn, string ...
method Select (line 234) | public static IEnumerable<T> Select<T>(this DbConnection conn, string ...
method Select (line 236) | public static IEnumerable<T> Select<T>(this DbConnection conn, string ...
method Select (line 238) | public static IEnumerable<T> Select<T>(this DbConnection conn, string ...
method SelectAsync (line 253) | public static Task<IEnumerable<T>> SelectAsync<T>(this DbConnection co...
method SelectAsync (line 255) | public static Task<IEnumerable<T>> SelectAsync<T>(this DbConnection co...
method SelectAsync (line 257) | public static Task<IEnumerable<T>> SelectAsync<T>(this DbConnection co...
method SelectAsync (line 259) | public static Task<IEnumerable<T>> SelectAsync<T>(this DbConnection co...
method SelectAsync (line 261) | public static Task<IEnumerable<T>> SelectAsync<T>(this DbConnection co...
method SelectAsync (line 263) | public static async Task<IEnumerable<T>> SelectAsync<T>(this DbConnect...
method Select (line 277) | public static IEnumerable<dynamic> Select(this DbConnection conn, stri...
method Select (line 279) | public static IEnumerable<dynamic> Select(this DbConnection conn, stri...
method Select (line 281) | public static IEnumerable<dynamic> Select(this DbConnection conn, stri...
method Select (line 283) | public static IEnumerable<dynamic> Select(this DbConnection conn, stri...
method Select (line 285) | public static IEnumerable<dynamic> Select(this DbConnection conn, stri...
method SelectAsync (line 300) | public static Task<IEnumerable<dynamic>> SelectAsync(this DbConnection...
method SelectAsync (line 302) | public static Task<IEnumerable<dynamic>> SelectAsync(this DbConnection...
method SelectAsync (line 304) | public static Task<IEnumerable<dynamic>> SelectAsync(this DbConnection...
method SelectAsync (line 306) | public static Task<IEnumerable<dynamic>> SelectAsync(this DbConnection...
method SelectAsync (line 308) | public static Task<IEnumerable<dynamic>> SelectAsync(this DbConnection...
method SelectAsync (line 310) | public static async Task<IEnumerable<dynamic>> SelectAsync(this DbConn...
method ExecuteDataTable (line 326) | public static T ExecuteDataTable<T>(this DbConnection conn, string cmd...
method ExecuteDataTable (line 328) | public static T ExecuteDataTable<T>(this DbConnection conn, string cmd...
method ExecuteDataTable (line 330) | public static T ExecuteDataTable<T>(this DbConnection conn, string cmd...
method ExecuteDataTable (line 332) | public static T ExecuteDataTable<T>(this DbConnection conn, string cmd...
method ExecuteDataTable (line 334) | public static T ExecuteDataTable<T>(this DbConnection conn, string cmd...
method ExecuteDataTableAsync (line 348) | public static Task<T> ExecuteDataTableAsync<T>(this DbConnection conn,...
method ExecuteDataTableAsync (line 350) | public static Task<T> ExecuteDataTableAsync<T>(this DbConnection conn,...
method ExecuteDataTableAsync (line 352) | public static Task<T> ExecuteDataTableAsync<T>(this DbConnection conn,...
method ExecuteDataTableAsync (line 354) | public static Task<T> ExecuteDataTableAsync<T>(this DbConnection conn,...
method ExecuteDataTableAsync (line 356) | public static Task<T> ExecuteDataTableAsync<T>(this DbConnection conn,...
method ExecuteDataTableAsync (line 358) | public static async Task<T> ExecuteDataTableAsync<T>(this DbConnection...
method ExecuteScalarTo (line 372) | public static T ExecuteScalarTo<T>(this DbConnection conn, string cmdT...
method ExecuteScalarTo (line 374) | public static T ExecuteScalarTo<T>(this DbConnection conn, string cmdT...
method ExecuteScalarTo (line 376) | public static T ExecuteScalarTo<T>(this DbConnection conn, string cmdT...
method ExecuteScalarTo (line 378) | public static T ExecuteScalarTo<T>(this DbConnection conn, string cmdT...
method ExecuteScalarTo (line 380) | public static T ExecuteScalarTo<T>(this DbConnection conn, string cmdT...
method ExecuteScalarToAsync (line 395) | public static Task<T> ExecuteScalarToAsync<T>(this DbConnection conn, ...
method ExecuteScalarToAsync (line 397) | public static Task<T> ExecuteScalarToAsync<T>(this DbConnection conn, ...
method ExecuteScalarToAsync (line 399) | public static Task<T> ExecuteScalarToAsync<T>(this DbConnection conn, ...
method ExecuteScalarToAsync (line 401) | public static Task<T> ExecuteScalarToAsync<T>(this DbConnection conn, ...
method ExecuteScalarToAsync (line 403) | public static Task<T> ExecuteScalarToAsync<T>(this DbConnection conn, ...
method ExecuteScalarToAsync (line 405) | public static async Task<T> ExecuteScalarToAsync<T>(this DbConnection ...
method ExecuteScalarToOrDefault (line 418) | public static T? ExecuteScalarToOrDefault<T>(this DbConnection conn, s...
method ExecuteScalarToOrDefault (line 420) | public static T? ExecuteScalarToOrDefault<T>(this DbConnection conn, s...
method ExecuteScalarToOrDefault (line 422) | public static T? ExecuteScalarToOrDefault<T>(this DbConnection conn, s...
method ExecuteScalarToOrDefault (line 424) | public static T? ExecuteScalarToOrDefault<T>(this DbConnection conn, s...
method ExecuteScalarToOrDefault (line 426) | public static T? ExecuteScalarToOrDefault<T>(this DbConnection conn, s...
method ExecuteScalarToOrDefaultAsync (line 441) | public static Task<T?> ExecuteScalarToOrDefaultAsync<T>(this DbConnect...
method ExecuteScalarToOrDefaultAsync (line 443) | public static Task<T?> ExecuteScalarToOrDefaultAsync<T>(this DbConnect...
method ExecuteScalarToOrDefaultAsync (line 445) | public static Task<T?> ExecuteScalarToOrDefaultAsync<T>(this DbConnect...
method ExecuteScalarToOrDefaultAsync (line 447) | public static Task<T?> ExecuteScalarToOrDefaultAsync<T>(this DbConnect...
method ExecuteScalarToOrDefaultAsync (line 449) | public static Task<T?> ExecuteScalarToOrDefaultAsync<T>(this DbConnect...
method ExecuteScalarToOrDefaultAsync (line 451) | public static async Task<T?> ExecuteScalarToOrDefaultAsync<T>(this DbC...
method QueryColumn (line 465) | public static IEnumerable<T> QueryColumn<T>(this DbConnection conn, st...
method QueryColumn (line 467) | public static IEnumerable<T> QueryColumn<T>(this DbConnection conn, st...
method QueryColumn (line 469) | public static IEnumerable<T> QueryColumn<T>(this DbConnection conn, st...
method QueryColumn (line 471) | public static IEnumerable<T> QueryColumn<T>(this DbConnection conn, st...
method QueryColumn (line 473) | public static IEnumerable<T> QueryColumn<T>(this DbConnection conn, st...
method QueryColumn (line 475) | public static IEnumerable<T> QueryColumn<T>(this DbConnection conn, st...
method QueryColumnAsync (line 498) | public static Task<IEnumerable<T>> QueryColumnAsync<T>(this DbConnecti...
method QueryColumnAsync (line 500) | public static Task<IEnumerable<T>> QueryColumnAsync<T>(this DbConnecti...
method QueryColumnAsync (line 503) | public static Task<IEnumerable<T>> QueryColumnAsync<T>(this DbConnecti...
method QueryColumnAsync (line 505) | public static Task<IEnumerable<T>> QueryColumnAsync<T>(this DbConnecti...
method QueryColumnAsync (line 507) | public static Task<IEnumerable<T>> QueryColumnAsync<T>(this DbConnecti...
method QueryColumnAsync (line 509) | public static async Task<IEnumerable<T>> QueryColumnAsync<T>(this DbCo...
method SelectColumn (line 532) | public static IEnumerable<T> SelectColumn<T>(this DbConnection conn, s...
method SelectColumn (line 534) | public static IEnumerable<T> SelectColumn<T>(this DbConnection conn, s...
method SelectColumn (line 536) | public static IEnumerable<T> SelectColumn<T>(this DbConnection conn, s...
method SelectColumn (line 538) | public static IEnumerable<T> SelectColumn<T>(this DbConnection conn, s...
method SelectColumn (line 540) | public static IEnumerable<T> SelectColumn<T>(this DbConnection conn, s...
method SelectColumn (line 542) | public static IEnumerable<T> SelectColumn<T>(this DbConnection conn, s...
method SelectColumnAsync (line 565) | public static Task<IEnumerable<T>> SelectColumnAsync<T>(this DbConnect...
method SelectColumnAsync (line 567) | public static Task<IEnumerable<T>> SelectColumnAsync<T>(this DbConnect...
method SelectColumnAsync (line 570) | public static Task<IEnumerable<T>> SelectColumnAsync<T>(this DbConnect...
method SelectColumnAsync (line 572) | public static Task<IEnumerable<T>> SelectColumnAsync<T>(this DbConnect...
method SelectColumnAsync (line 574) | public static Task<IEnumerable<T>> SelectColumnAsync<T>(this DbConnect...
method SelectColumnAsync (line 576) | public static async Task<IEnumerable<T>> SelectColumnAsync<T>(this DbC...
FILE: src/WeihanLi.Common/Extensions/DictionaryExtension.cs
class DictionaryExtension (line 13) | public static class DictionaryExtension
method TryGetValue (line 25) | public static bool TryGetValue<TKey, TValue>(this IDictionary<TKey, TV...
method AddIfNotContainsKey (line 48) | public static bool AddIfNotContainsKey<TKey, TValue>(this IDictionary<...
method AddIfNotContainsKey (line 68) | public static bool AddIfNotContainsKey<TKey, TValue>(this IDictionary<...
method AddIfNotContainsKey (line 88) | public static bool AddIfNotContainsKey<TKey, TValue>(this IDictionary<...
method GetOrAdd (line 111) | public static TValue GetOrAdd<TKey, TValue>(this IDictionary<TKey, TVa...
method GetOrAdd (line 134) | public static TValue GetOrAdd<TKey, TValue>(this IDictionary<TKey, TVa...
method AddOrUpdate (line 155) | public static TValue AddOrUpdate<TKey, TValue>(this IDictionary<TKey, ...
method AddOrUpdate (line 187) | public static TValue AddOrUpdate<TKey, TValue>(this IDictionary<TKey, ...
method AddOrUpdate (line 219) | public static TValue AddOrUpdate<TKey, TValue>(this IDictionary<TKey, ...
method RemoveIfContainsKey (line 240) | public static void RemoveIfContainsKey<TKey, TValue>(this IDictionary<...
method ToSortedDictionary (line 255) | public static SortedDictionary<TKey, TValue> ToSortedDictionary<TKey, ...
method ToSortedDictionary (line 268) | public static SortedDictionary<TKey, TValue> ToSortedDictionary<TKey, ...
method ContainsAnyKey (line 281) | public static bool ContainsAnyKey<TKey, TValue>(this IDictionary<TKey,...
method ContainsAllKey (line 302) | public static bool ContainsAllKey<TKey, TValue>(this IDictionary<TKey,...
method ToNameValueCollection (line 320) | public static NameValueCollection ToNameValueCollection(this IDictiona...
method ToNameValueCollection (line 334) | public static NameValueCollection ToNameValueCollection(this IEnumerab...
method ToDbParameters (line 361) | public static DbParameter[] ToDbParameters(this IDictionary<string, ob...
method ToDbParameters (line 378) | public static DbParameter[] ToDbParameters(this IDictionary<string, ob...
method ToDataTable (line 396) | public static DataTable ToDataTable(this IDictionary<string, object> d...
method ToDictionary (line 414) | public static Dictionary<TKey, TValue> ToDictionary<TKey, TValue>(this...
method ToKeyValuePair (line 416) | public static IEnumerable<KeyValuePair<string, string?>> ToKeyValuePai...
method ToQueryString (line 434) | public static string ToQueryString(this IEnumerable<KeyValuePair<strin...
FILE: src/WeihanLi.Common/Extensions/DumpExtension.cs
class DumpExtension (line 6) | public static class DumpExtension
method Dump (line 10) | public static void Dump<T>(this T t) => Dump(t, Console.WriteLine);
method Dump (line 12) | public static void Dump<T>(this T t, Action<string> dumpAction)
method Dump (line 18) | public static void Dump<T>(this T t, Action<string> dumpAction, Func<T...
method DumpAsync (line 24) | public static Task DumpAsync<T>(this T t, Func<string, Task> dumpAction)
method DumpAsync (line 30) | public static Task DumpAsync<T>(this T t, Func<string, Task> dumpActio...
method DumpAsync (line 36) | public static ValueTask DumpAsync<T>(this T t, Func<string, ValueTask>...
method DumpAsync (line 42) | public static ValueTask DumpAsync<T>(this T t, Func<string, ValueTask>...
FILE: src/WeihanLi.Common/Extensions/EnumerableExtension.cs
class EnumerableExtension (line 14) | public static class EnumerableExtension
method ForEach (line 16) | public static void ForEach<T>(this IEnumerable<T> ts, Action<T> action)
method ForEach (line 24) | public static void ForEach<T>(this IEnumerable<T> ts, Action<T, int> a...
method ForEachAsync (line 34) | public static async Task ForEachAsync<T>(this IEnumerable<T> ts, Func<...
method ForEachAsync (line 42) | public static async Task ForEachAsync<T>(this IEnumerable<T> ts, Func<...
method AsReadOnly (line 58) | public static IReadOnlyCollection<T> AsReadOnly<T>(this IEnumerable<T>...
method HasValue (line 69) | public static bool HasValue<T>([NotNullWhen(true)] this IEnumerable<T>...
method StringJoin (line 87) | public static string StringJoin<T>(this IEnumerable<T> @this, string s...
method Prepend (line 94) | public static IEnumerable<TSource> Prepend<TSource>(this IEnumerable<T...
method Append (line 104) | public static IEnumerable<TSource> Append<TSource>(this IEnumerable<TS...
method Split (line 123) | public static IEnumerable<T[]> Split<T>(this IEnumerable<T> source, in...
method Split (line 132) | private static IEnumerable<T> Split<T>(IEnumerator<T> enumerator, int ...
method WhereIf (line 142) | public static IEnumerable<T> WhereIf<T>(this IEnumerable<T> source, Fu...
method WhereIf (line 145) | public static IEnumerable<T> WhereIf<T>(this IEnumerable<T> source, Fu...
method WhereNotNull (line 148) | [return: NotNull]
method Flatten (line 152) | public static IEnumerable<T> Flatten<T>(this IEnumerable<IEnumerable<T...
method Distinct (line 155) | public static IEnumerable<T> Distinct<T>(this IEnumerable<T> source, F...
class DynamicEqualityComparer (line 159) | private sealed class DynamicEqualityComparer<T>(Func<T?, T?, bool> fun...
method Equals (line 164) | public bool Equals(T? x, T? y) => _func(x, y);
method GetHashCode (line 166) | public int GetHashCode(T obj) => 0;
method LeftJoin (line 185) | public static IEnumerable<TResult> LeftJoin<TOuter, TInner, TKey, TRes...
method ToListResultWithTotal (line 207) | public static IListResultWithTotal<T> ToListResultWithTotal<T>(this IE...
method ToPagedList (line 223) | public static IPagedListResult<T> ToPagedList<T>(this IEnumerable<T> d...
method ToPagedList (line 242) | public static IPagedListResult<T> ToPagedList<T>(this IReadOnlyList<T>...
method GetCombinations (line 254) | public static IEnumerable<IReadOnlyList<T>> GetCombinations<T>(this IE...
method GetPermutations (line 261) | public static IEnumerable<IReadOnlyList<T>> GetPermutations<T>(this IE...
method GroupByEquality (line 268) | public static IEnumerable<IGrouping<TKey, T>> GroupByEquality<T, TKey>...
method GroupByEquality (line 276) | public static IEnumerable<IGrouping<TKey, T>> GroupByEquality<T, TKey>...
class Grouping (line 313) | private sealed class Grouping<TKey, T>(TKey key) : IGrouping<TKey, T>
method Add (line 319) | public void Add(T t) => _items.Add(t);
method GetEnumerator (line 323) | public IEnumerator<T> GetEnumerator()
method GetEnumerator (line 328) | IEnumerator IEnumerable.GetEnumerator()
FILE: src/WeihanLi.Common/Extensions/ExceptionExtension.cs
class ExceptionExtension (line 10) | public static class ExceptionExtension
method Unwrap (line 18) | [return: NotNullIfNotNull(nameof(ex))]
method IsFatal (line 43) | public static bool IsFatal(this Exception? exception)
FILE: src/WeihanLi.Common/Extensions/ExpressionExtension.cs
class ExpressionExtension (line 9) | public static class ExpressionExtension
method Or (line 13) | public static Expression<Func<T, bool>> Or<T>(this Expression<Func<T, ...
method And (line 26) | public static Expression<Func<T, bool>> And<T>(this Expression<Func<T,...
method AndIf (line 40) | public static Expression<Func<T, bool>> AndIf<T>(this Expression<Func<...
class ReplaceExpressionVisitor (line 57) | private sealed class ReplaceExpressionVisitor(Expression oldValue, Exp...
method Visit (line 62) | public override Expression? Visit(Expression? node)
method GetMethod (line 71) | public static MethodInfo GetMethod<T>(this Expression<T> expression)
method GetMethodExpression (line 82) | public static MethodCallExpression GetMethodExpression<T>(this Express...
method GetMethodExpression (line 89) | public static MethodCallExpression GetMethodExpression<T>(this Express...
method GetMemberName (line 113) | public static string
method GetMemberInfo (line 124) | public static MemberInfo GetMemberInfo<TEntity, TMember>(this Expressi...
method GetProperty (line 144) | public static PropertyInfo GetProperty<[DynamicallyAccessedMembers(Dyn...
method ExtractMemberExpression (line 158) | private static MemberExpression ExtractMemberExpression(Expression exp...
FILE: src/WeihanLi.Common/Extensions/FuncExtension.cs
class FuncExtension (line 6) | public static class FuncExtension
method WrapTask (line 8) | public static Func<Task> WrapTask(this Action action)
method WrapTask (line 17) | public static Func<T, Task> WrapTask<T>(this Action<T> action)
method WrapTask (line 26) | public static Func<T1, T2, Task> WrapTask<T1, T2>(this Action<T1, T2> ...
method WrapTask (line 35) | public static Func<T1, T2, T3, Task> WrapTask<T1, T2, T3>(this Action<...
method WrapTask (line 44) | public static Func<T1, T2, T3, T4, Task> WrapTask<T1, T2, T3, T4>(this...
method WrapValueTask (line 53) | public static Func<T, ValueTask> WrapValueTask<T>(this Action<T> action)
method WrapValueTask (line 62) | public static Func<T1, T2, ValueTask> WrapValueTask<T1, T2>(this Actio...
method WrapValueTask (line 71) | public static Func<T1, T2, T3, ValueTask> WrapValueTask<T1, T2, T3>(th...
method WrapValueTask (line 80) | public static Func<T1, T2, T3, T4, ValueTask> WrapValueTask<T1, T2, T3...
method WrapCancellation (line 89) | public static Func<CancellationToken, Task> WrapCancellation(this Func...
method WrapCancellation (line 91) | public static Func<T, CancellationToken, Task> WrapCancellation<T>(thi...
method WrapCancellation (line 93) | public static Func<T1, T2, CancellationToken, Task> WrapCancellation<T...
method WrapCancellation (line 95) | public static Func<T1, T2, T3, CancellationToken, Task> WrapCancellati...
method WrapCancellation (line 97) | public static Func<T1, T2, T3, T4, CancellationToken, Task> WrapCancel...
FILE: src/WeihanLi.Common/Extensions/HttpClientExtension.cs
class HttpClientExtension (line 10) | public static class HttpClientExtension
class BasicAuthenticationHeaderValue (line 21) | private sealed class BasicAuthenticationHeaderValue(string userName, s...
method EncodeCredential (line 23) | private static string EncodeCredential(string userName, string passw...
method UrlEncode (line 29) | private static string UrlEncode(string value)
method PostJsonRequestAsync (line 40) | public static Task<HttpResponseMessage> PostJsonRequestAsync<T>(this H...
method PutJsonRequestAsync (line 47) | public static Task<HttpResponseMessage> PutJsonRequestAsync<T>(this Ht...
method PostJsonAsync (line 54) | public static Task<TResponse?> PostJsonAsync<TRequest, TResponse>
method PutJsonAsync (line 65) | public static Task<TResponse?> PutJsonAsync<TRequest, TResponse>
method HttpJsonRequestAsync (line 74) | public static async Task<HttpResponseMessage> HttpJsonRequestAsync<TRe...
method ReadJsonResponseAsync (line 86) | public static async Task<TResponse?> ReadJsonResponseAsync<TResponse>
method HttpJsonAsync (line 100) | public static async Task<TResponse?> HttpJsonAsync<TRequest, TResponse>
method PatchJsonRequestAsync (line 124) | public static Task<HttpResponseMessage> PatchJsonRequestAsync<T>(this ...
method PatchJsonAsync (line 131) | public static Task<TResponse?> PatchJsonAsync<TRequest, TResponse>
method PostAsFormAsync (line 143) | public static Task<HttpResponseMessage> PostAsFormAsync(this HttpClien...
method PutAsFormAsync (line 149) | public static Task<HttpResponseMessage> PutAsFormAsync(this HttpClient...
method PostFileAsync (line 162) | public static Task<HttpResponseMessage> PostFileAsync(this HttpClient ...
method PostFileAsync (line 194) | public static async Task<HttpResponseMessage> PostFileAsync(this HttpC...
method PostFileAsync (line 221) | public static Task<HttpResponseMessage> PostFileAsync(this HttpClient
method PostFileAsync (line 236) | public static async Task<HttpResponseMessage> PostFileAsync(this HttpC...
method SetBasicAuthentication (line 271) | public static void SetBasicAuthentication(this HttpClient client, stri...
method SetBasicAuthentication (line 280) | public static void SetBasicAuthentication(this HttpRequestMessage requ...
method SetBasicAuthenticationOAuth (line 288) | public static void SetBasicAuthenticationOAuth(this HttpRequestMessage...
method SetToken (line 296) | public static void SetToken(this HttpClient client, string scheme, str...
method SetToken (line 305) | public static void SetToken(this HttpRequestMessage request, string sc...
method SetBearerToken (line 312) | public static void SetBearerToken(this HttpClient client, string token...
method SetBearerToken (line 319) | public static void SetBearerToken(this HttpRequestMessage request, str...
method TryAddHeader (line 328) | public static HttpRequestMessage TryAddHeader(this HttpRequestMessage ...
method TryAddHeaderIfNotExists (line 352) | public static HttpRequestMessage TryAddHeaderIfNotExists(this HttpRequ...
FILE: src/WeihanLi.Common/Extensions/HttpRequesterExtension.cs
class HttpRequesterExtension (line 9) | public static class HttpRequesterExtension
method WithUrl (line 11) | public static IHttpRequester WithUrl(this IHttpRequester httpRequester...
method AjaxRequest (line 19) | public static IHttpRequester AjaxRequest(this IHttpRequester httpReque...
method WithCookie (line 27) | public static IHttpRequester WithCookie(this IHttpRequester httpReques...
method WithCookie (line 32) | public static IHttpRequester WithCookie(this IHttpRequester httpReques...
method WithCookie (line 37) | public static IHttpRequester WithCookie(this IHttpRequester httpReques...
method WithProxy (line 42) | public static IHttpRequester WithProxy(this IHttpRequester httpRequest...
method WithProxy (line 47) | public static IHttpRequester WithProxy(this IHttpRequester httpRequest...
method WithXmlParameter (line 55) | [RequiresUnreferencedCode("Members from serialized types may be trimme...
method WithJsonParameter (line 61) | [RequiresUnreferencedCode("Members from serialized types may be trimme...
method WithFormParams (line 67) | public static IHttpRequester WithFormParams(this IHttpRequester httpRe...
method WithFile (line 73) | public static IHttpRequester WithFile(this IHttpRequester httpRequeste...
method WithFiles (line 77) | public static IHttpRequester WithFiles(this IHttpRequester httpRequest...
method Execute (line 84) | public static string Execute(this IHttpRequester httpRequester) => htt...
method Execute (line 86) | [RequiresUnreferencedCode("Generic TypeConverters may require the gene...
method ExecuteAsync (line 89) | public static Task<string> ExecuteAsync(this IHttpRequester httpReques...
method ExecuteAsync (line 94) | [RequiresUnreferencedCode("Generic TypeConverters may require the gene...
method ExecuteForJson (line 100) | public static TEntity ExecuteForJson<TEntity>(this IHttpRequester http...
method ExecuteForJsonAsync (line 105) | public static Task<TEntity> ExecuteForJsonAsync<TEntity>(this IHttpReq...
method ExecuteForXml (line 110) | [RequiresUnreferencedCode("Members from serialized types may be trimme...
method ExecuteForXmlAsync (line 116) | [RequiresUnreferencedCode("Members from serialized types may be trimme...
FILE: src/WeihanLi.Common/Extensions/ILGeneratorExtensions.cs
class ILGeneratorExtensions (line 11) | public static class ILGeneratorExtensions
method EmitMethod (line 15) | [RequiresDynamicCode("Defining a dynamic assembly requires dynamic cod...
method EmitMethod (line 25) | [RequiresDynamicCode("Defining a dynamic assembly requires dynamic cod...
method EmitConvertToObject (line 39) | [RequiresDynamicCode("Defining a dynamic assembly requires dynamic cod...
method EmitConvertFromObject (line 57) | [RequiresDynamicCode("Defining a dynamic assembly requires dynamic cod...
method EmitConvertToType (line 75) | [RequiresDynamicCode("Defining a dynamic assembly requires dynamic cod...
method EmitNullableConversion (line 126) | [RequiresDynamicCode("Defining a dynamic assembly requires dynamic cod...
method EmitNullableToNullableConversion (line 143) | [RequiresDynamicCode("Defining a dynamic assembly requires dynamic cod...
method EmitNullableToNonNullableConversion (line 177) | [RequiresDynamicCode("Defining a dynamic assembly requires dynamic cod...
method EmitNullableToNonNullableStructConversion (line 189) | [RequiresDynamicCode("Defining a dynamic assembly requires dynamic cod...
method EmitNullableToReferenceConversion (line 203) | private static void EmitNullableToReferenceConversion(this ILGenerator...
method EmitNonNullableToNullableConversion (line 210) | [RequiresDynamicCode("Defining a dynamic assembly requires dynamic cod...
method EmitNumericConversion (line 226) | private static void EmitNumericConversion(this ILGenerator ilGenerator...
method EmitCastToType (line 389) | public static void EmitCastToType(this ILGenerator ilGenerator, Type t...
method DeclareReturnValue (line 415) | public static LocalBuilder? DeclareReturnValue(this ILGenerator il, Ty...
method Return (line 425) | public static void Return(this ILGenerator il, MethodInfo method, Loca...
method Call (line 436) | public static void Call(this ILGenerator il, MethodInfo method)
method Call (line 441) | public static void Call(this ILGenerator il, ConstructorInfo constructor)
method New (line 446) | public static void New(this ILGenerator il, ConstructorInfo constructor)
method LoadObj (line 452) | public static void LoadObj(this ILGenerator il, object? obj)
method EmitThis (line 473) | public static void EmitThis(this ILGenerator ilGenerator)
method EmitLoadArg (line 480) | public static void EmitLoadArg(this ILGenerator ilGenerator, int index)
method EmitNull (line 515) | public static void EmitNull(this ILGenerator ilGenerator)
method EmitString (line 520) | public static void EmitString(this ILGenerator ilGenerator, string value)
method EmitBoolean (line 525) | public static void EmitBoolean(this ILGenerator ilGenerator, bool value)
method EmitHasValue (line 537) | public static void EmitHasValue(this ILGenerator ilGenerator, [Dynamic...
method EmitGetValueOrDefault (line 545) | public static void EmitGetValueOrDefault(this ILGenerator ilGenerator,...
method EmitGetValue (line 551) | public static void EmitGetValue(this ILGenerator ilGenerator, [Dynamic...
method EmitDefaultValue (line 557) | public static void EmitDefaultValue(this ILGenerator ilGenerator, Type...
class TypeInfoUtils (line 625) | internal static class TypeInfoUtils
method AreEquivalent (line 627) | internal static bool AreEquivalent(Type t1, Type t2)
method GetNonNullableType (line 632) | internal static Type GetNonNullableType(this Type type)
method IsLegalExplicitVariantDelegateConversion (line 641) | internal static bool IsLegalExplicitVariantDelegateConversion(Type sou...
method IsDelegate (line 690) | private static bool IsDelegate(Type t)
method IsInvariant (line 695) | private static bool IsInvariant(Type t)
method IsCovariant (line 700) | private static bool IsCovariant(this Type t)
method HasReferenceConversion (line 705) | internal static bool HasReferenceConversion(Type source, Type dest)
method IsContravariant (line 745) | private static bool IsContravariant(Type t)
method IsConvertible (line 750) | internal static bool IsConvertible(this Type type)
method IsUnsigned (line 778) | internal static bool IsUnsigned(Type type)
method IsFloatingPoint (line 794) | internal static bool IsFloatingPoint(Type type)
FILE: src/WeihanLi.Common/Extensions/IOExtension.cs
class IOExtension (line 7) | public static class IOExtension
method Write (line 15) | public static void Write(this Stream @this, byte[] byteArray)
method WriteAsync (line 26) | public static Task WriteAsync(this Stream @this, byte[] byteArray)
method Append (line 37) | public static Stream Append(this Stream @this, Stream stream)
method AppendAsync (line 49) | public static async Task<Stream> AppendAsync(this Stream @this, Stream...
method ToByteArray (line 60) | public static byte[] ToByteArray(this Stream @this)
method ToByteArrayAsync (line 75) | public static async Task<byte[]> ToByteArrayAsync(this Stream @this)
method ReadToEnd (line 93) | public static string ReadToEnd(this Stream @this)
method ReadToEnd (line 108) | public static string ReadToEnd(this Stream @this, Encoding encoding)
method ReadToEndAsync (line 122) | public static async Task<string> ReadToEndAsync(this Stream @this)
method ReadToEndAsync (line 137) | public static async Task<string> ReadToEndAsync(this Stream @this, Enc...
FILE: src/WeihanLi.Common/Extensions/JsonSerializeExtension.cs
class JsonSerializeExtension (line 8) | public static class JsonSerializeExtension
method GetDefaultSerializerSettings (line 17) | private static JsonSerializerSettings GetDefaultSerializerSettings() =...
method SerializerSettingsWith (line 24) | public static JsonSerializerSettings SerializerSettingsWith(Action<Jso...
method ToJson (line 39) | public static string ToJson(this object? obj)
method ToJson (line 48) | public static string ToJson(this object obj, JsonSerializerSettings? s...
method ToIndentedJson (line 56) | public static string ToIndentedJson(this object obj) => obj.ToJson(fal...
method ToJson (line 63) | public static string ToJson(this object? obj, bool isConvertToSingleQu...
method ToJson (line 71) | public static string ToJson(this object? obj, bool isConvertToSingleQu...
method JsonToObject (line 91) | public static T JsonToObject<T>(this string jsonString)
method JsonToObject (line 101) | public static T JsonToObject<T>(this string jsonString, JsonSerializer...
method ToJsonOrString (line 109) | public static string ToJsonOrString(this object? obj)
method StringToType (line 132) | [RequiresUnreferencedCode("Generic TypeConverters may require the gene...
method StringToType (line 153) | [RequiresUnreferencedCode("Generic TypeConverters may require the gene...
FILE: src/WeihanLi.Common/Extensions/NetExtension.cs
class NetExtension (line 8) | public static class NetExtension
method GetResponseSafe (line 17) | public static WebResponse GetResponseSafe(this WebRequest @this)
method GetResponseSafeAsync (line 34) | public static async Task<WebResponse> GetResponseSafeAsync(this WebReq...
method GetResponseBytes (line 46) | public static byte[] GetResponseBytes(this WebRequest @this)
method GetResponseBytesAsync (line 52) | public static async Task<byte[]> GetResponseBytesAsync(this WebRequest...
method GetResponseString (line 58) | public static string GetResponseString(this WebRequest @this)
method GetResponseStringAsync (line 64) | public static async Task<string> GetResponseStringAsync(this WebReques...
method GetResponseBytesSafe (line 70) | public static byte[] GetResponseBytesSafe(this WebRequest @this)
method GetResponseBytesSafeAsync (line 76) | public static async Task<byte[]> GetResponseBytesSafeAsync(this WebReq...
method GetResponseStringSafe (line 82) | public static string GetResponseStringSafe(this WebRequest @this)
method GetResponseStringSafeAsync (line 88) | public static async Task<string> GetResponseStringSafeAsync(this WebRe...
method ReadAllBytes (line 103) | public static byte[] ReadAllBytes(this WebResponse @this)
method ReadAllBytesAsync (line 116) | public static async Task<byte[]> ReadAllBytesAsync(this WebResponse @t...
method ReadToEnd (line 129) | public static string ReadToEnd(this WebResponse response)
method ReadToEndAsync (line 140) | public static async Task<string> ReadToEndAsync(this WebResponse @this)
FILE: src/WeihanLi.Common/Extensions/ProcessExtension.cs
class ProcessExtension (line 13) | public static class ProcessExtension
method WithEnv (line 15) | public static ProcessStartInfo WithEnv(this ProcessStartInfo processSt...
method WaitForExitAsync (line 23) | public static Task WaitForExitAsync(this Process process, Cancellation...
method Execute (line 58) | public static int Execute(this ProcessStartInfo processStartInfo)
method ExecuteAsync (line 73) | public static async Task<int> ExecuteAsync(this ProcessStartInfo proce...
method GetResult (line 89) | public static CommandResult GetResult(this ProcessStartInfo psi)
method GetResultAsync (line 120) | public static async Task<CommandResult> GetResultAsync(this ProcessSta...
method GetExitCode (line 157) | public static int GetExitCode(this ProcessStartInfo psi, TextWriter? s...
method GetExitCodeAsync (line 179) | public static async Task<int> GetExitCodeAsync(this ProcessStartInfo p...
method ExecuteProcess (line 201) | public static Process ExecuteProcess(this ProcessStartInfo psi, TextWr...
method ExecuteProcessAsync (line 239) | public static async Task<Process> ExecuteProcessAsync(this ProcessStar...
method TryKill (line 284) | public static bool TryKill(this Process process, bool entireProcessTre...
FILE: src/WeihanLi.Common/Extensions/PropertiesExtensions.cs
class PropertiesExtensions (line 8) | public static class PropertiesExtensions
method GetProperty (line 10) | public static T? GetProperty<T>(this IDictionary<string, object?> prop...
method SetProperty (line 15) | public static void SetProperty<T>(this IDictionary<string, object?> pr...
method GetProperty (line 20) | public static T? GetProperty<T>(this IProperties propertiesHolder, str...
method SetProperty (line 26) | public static void SetProperty<T>(this IProperties propertiesHolder, s...
FILE: src/WeihanLi.Common/Extensions/QueryableExtension.cs
class QueryableExtension (line 9) | public static class QueryableExtension
method WhereIf (line 11) | public static IQueryable<T> WhereIf<T>(this IQueryable<T> source, Expr...
method WhereIf (line 16) | public static IQueryable<T> WhereIf<T>(this IQueryable<T> source, Expr...
method ToListResultWithTotal (line 29) | public static ListResultWithTotal<T> ToListResultWithTotal<T>(this IQu...
method ToPagedList (line 66) | public static PagedListResult<T> ToPagedList<T>(this IQueryable<T> sou...
method OrderBy (line 105) | [RequiresDynamicCode("The native code for this instantiation might not...
FILE: src/WeihanLi.Common/Extensions/ReflectionExtension.cs
class ReflectionExtension (line 13) | public static class ReflectionExtension
method GetMethodBySignature (line 15) | public static MethodInfo? GetMethodBySignature([DynamicallyAccessedMem...
method GetBaseMethod (line 63) | [RequiresUnreferencedCode("Unreferenced code may be used.")]
method IsVisibleAndVirtual (line 72) | public static bool IsVisibleAndVirtual(this PropertyInfo property)
method IsVisibleAndVirtual (line 79) | public static bool IsVisibleAndVirtual(this MethodInfo method)
method IsVisible (line 90) | public static bool IsVisible(this MethodBase method)
method GetDisplayName (line 101) | public static string GetDisplayName(this MemberInfo @this)
method GetColumnName (line 108) | public static string GetColumnName(this PropertyInfo propertyInfo) => ...
method GetDescription (line 114) | public static string GetDescription(this MemberInfo @this) => Guard.No...
method GetValueGetter (line 116) | public static Func<T, object?>? GetValueGetter<T>(this PropertyInfo pr...
method GetValueGetter (line 131) | public static Func<object, object?>? GetValueGetter(this PropertyInfo ...
method GetValueSetter (line 150) | public static Action<T, object?>? GetValueSetter<T>(this PropertyInfo ...
method GetValueSetter (line 165) | public static Action<object, object?>? GetValueSetter(this PropertyInf...
method GetCustomAttribute (line 200) | public static Attribute? GetCustomAttribute(this Assembly element, Typ...
method GetCustomAttribute (line 217) | public static Attribute? GetCustomAttribute(this Assembly element, Typ...
method GetCustomAttributes (line 233) | public static Attribute[] GetCustomAttributes(this Assembly element, T...
method GetCustomAttributes (line 250) | public static Attribute[] GetCustomAttributes(this Assembly element, T...
method GetCustomAttributes (line 264) | public static Attribute[] GetCustomAttributes(this Assembly element)
method GetCustomAttributes (line 280) | public static Attribute[] GetCustomAttributes(this Assembly element, b...
method IsDefined (line 293) | public static bool IsDefined(this Assembly element, Type attributeType)
method IsDefined (line 307) | public static bool IsDefined(this Assembly element, Type attributeType...
method GetDisplayVersion (line 318) | public static string? GetDisplayVersion(this Assembly assembly)
FILE: src/WeihanLi.Common/Extensions/ServiceCollectionExtension.cs
type IServiceModule (line 14) | public interface IServiceModule
method ConfigureServices (line 16) | void ConfigureServices(IServiceCollection services);
class ServiceCollectionExtension (line 19) | public static class ServiceCollectionExtension
method RegisterAssemblyTypes (line 27) | [RequiresUnreferencedCode("Unreferenced code may be used")]
method RegisterAssemblyTypes (line 38) | [RequiresUnreferencedCode("Unreferenced code may be used")]
method RegisterAssemblyTypes (line 50) | [RequiresUnreferencedCode("Unreferenced code may be used")]
method RegisterAssemblyTypes (line 63) | [RequiresUnreferencedCode("Unreferenced code may be used")]
method RegisterAssemblyTypesAsImplementedInterfaces (line 95) | [RequiresUnreferencedCode("Unreferenced code may be used")]
method RegisterAssemblyTypesAsImplementedInterfaces (line 107) | [RequiresUnreferencedCode("Unreferenced code may be used")]
method RegisterAssemblyTypesAsImplementedInterfaces (line 119) | [RequiresUnreferencedCode("Unreferenced code may be used")]
method RegisterAssemblyTypesAsImplementedInterfaces (line 131) | [RequiresUnreferencedCode("Unreferenced code may be used")]
method RegisterAssemblyTypesAsImplementedInterfaces (line 146) | [RequiresUnreferencedCode("Unreferenced code may be used")]
method RegisterTypeAsImplementedInterfaces (line 185) | public static IServiceCollection RegisterTypeAsImplementedInterfaces(t...
method RegisterTypeAsImplementedInterfaces (line 198) | public static IServiceCollection RegisterTypeAsImplementedInterfaces(t...
method RegisterModule (line 220) | public static IServiceCollection RegisterModule<TServiceModule>(this I...
method RegisterAssemblyModules (line 233) | [RequiresUnreferencedCode("Unreferenced code may be used")]
method Decorate (line 269) | public static IServiceCollection Decorate<TService, [DynamicallyAccess...
method Decorate (line 284) | public static IServiceCollection Decorate(this IServiceCollection serv...
method CreateInstance (line 298) | private static object CreateInstance(this IServiceProvider services, S...
FILE: src/WeihanLi.Common/Extensions/StringExtension.cs
class StringExtension (line 11) | public static class StringExtension
method HtmlEncode (line 20) | public static string HtmlEncode(this string s)
method HtmlDecode (line 30) | public static string HtmlDecode(this string s)
method JavaScriptStringEncode (line 40) | public static string JavaScriptStringEncode(this string value)
method JavaScriptStringEncode (line 54) | public static string JavaScriptStringEncode(this string value, bool ad...
method ParseQueryString (line 64) | public static NameValueCollection ParseQueryString(this string query)
method ParseQueryString (line 75) | public static NameValueCollection ParseQueryString(this string query, ...
method UrlDecode (line 85) | public static string UrlDecode(this string str)
method UrlDecode (line 96) | public static string UrlDecode(this string str, Encoding e)
method UrlEncode (line 106) | public static string UrlEncode(this string str)
method UrlEncode (line 117) | public static string UrlEncode(this string str, Encoding e)
method Base64Encode (line 127) | public static string Base64Encode(this string str) => Base64Encode(str...
method Base64Encode (line 135) | public static string Base64Encode(this string str, Encoding encoding) ...
method Base64Decode (line 142) | public static string Base64Decode(this string str) => Base64Decode(str...
method Base64Decode (line 150) | public static string Base64Decode(this string str, Encoding encoding) ...
method Base64UrlEncode (line 157) | public static string Base64UrlEncode(this string str) => Base64UrlEnco...
method Base64UrlDecode (line 164) | public static string Base64UrlDecode(this string str) => Base64UrlEnco...
method GetTypeByTypeName (line 174) | [RequiresUnreferencedCode("The type might be removed")]
method GetNotEmptyValueOrDefault (line 208) | public static string GetNotEmptyValueOrDefault(this string? str, strin...
method GetValueOrDefault (line 219) | public static string GetValueOrDefault(this string? str, string defaul...
method GetValueOrDefault (line 230) | public static string GetValueOrDefault(this string? str, Func<string> ...
method SplitArray (line 242) | public static T[] SplitArray<T>(this string? str, StringSplitOptions s...
method SplitArray (line 252) | public static T[] SplitArray<T>(this string? str, char[] separators, S...
method TrimStart (line 270) | [return: NotNullIfNotNull(nameof(str))]
FILE: src/WeihanLi.Common/Extensions/TaskExtension.cs
class TaskExtension (line 7) | public static class TaskExtension
method WrapTask (line 9) | public static Task<T> WrapTask<T>(this T t) => Task.FromResult(t);
method WrapValueTask (line 11) | public static ValueTask<T> WrapValueTask<T>(this T t) => new(t);
method AsTask (line 13) | public static Task AsTask(this CancellationToken cancellationToken)
method WhenAny (line 23) | public static Task WhenAny(this IEnumerable<Task> tasks) => Task.WhenA...
method WhenAny (line 25) | public static Task<Task<TResult>> WhenAny<TResult>(this IEnumerable<Ta...
method WhenAll (line 27) | public static Task WhenAll(this IEnumerable<Task> tasks) => Task.WhenA...
method WhenAllSafely (line 29) | public static Task WhenAllSafely(this IEnumerable<Task> tasks, Action<...
method WhenAll (line 45) | public static Task<TResult[]> WhenAll<TResult>(this IEnumerable<Task<T...
method Run (line 56) | public static Task Run(this TaskScheduler scheduler, Action action, Ca...
method Run (line 70) | public static Task<T> Run<T>(this TaskScheduler scheduler, Func<T> fun...
method Run (line 83) | public static async Task Run(this TaskScheduler scheduler, Func<Task> ...
method Run (line 98) | public static async Task<T> Run<T>(this TaskScheduler scheduler, Func<...
method TimeoutAfter (line 107) | public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpa...
method TimeoutAfter (line 126) | public static async Task TimeoutAfter(this Task task, TimeSpan timeout,
method CreateMessage (line 148) | private static string CreateMessage(TimeSpan timeout, string? filePath...
FILE: src/WeihanLi.Common/Extensions/TypeExtension.cs
class TypeExtension (line 10) | public static class TypeExtension
method GetTypeCode (line 45) | public static TypeCode GetTypeCode(this Type type) => Type.GetTypeCode...
method IsValueTuple (line 47) | public static bool IsValueTuple(this Type type)
method GetDescription (line 55) | public static string? GetDescription(this Type type) =>
method IsPrimitiveType (line 64) | public static bool IsPrimitiveType(this Type type)
method IsPrimitiveType (line 67) | public static bool IsPrimitiveType<T>() => IsPrimitiveType(typeof(T));
method IsBasicType (line 69) | public static bool IsBasicType(this Type type)
method IsBasicType (line 75) | public static bool IsBasicType<T>() => IsBasicType(typeof(T));
method HasNamespace (line 77) | public static bool HasNamespace(this Type type) => Guard.NotNull(type)...
method GetConstructor (line 85) | [RequiresUnreferencedCode("Unreferenced code may be used")]
method GetEmptyConstructor (line 95) | public static ConstructorInfo? GetEmptyConstructor([DynamicallyAccesse...
method IsAssignableTo (line 112) | public static bool IsAssignableTo<T>(this Type @this)
method GetMatchingConstructor (line 124) | public static ConstructorInfo? GetMatchingConstructor([DynamicallyAcce...
method GetImplementedInterfaces (line 141) | public static IEnumerable<Type> GetImplementedInterfaces([DynamicallyA...
FILE: src/WeihanLi.Common/Guard.cs
class Guard (line 6) | public static class Guard
method NotNull (line 8) | [return: NotNull]
method NotNullOrEmpty (line 24) | [return: NotNull]
method NotNullOrWhiteSpace (line 41) | [return: NotNull]
method NotEmpty (line 57) | [return: NotNull]
method Ensure (line 68) | public static T Ensure<T>(Func<T, bool> condition, T t, [CallerArgumen...
method EnsureAsync (line 78) | public static async Task<T> EnsureAsync<T>(Func<T, Task<bool>> conditi...
method EnsureAsync (line 88) | public static async Task<T> EnsureAsync<T>(Func<T, ValueTask<bool>> co...
FILE: src/WeihanLi.Common/Helpers/ActivatorHelper.cs
class ParameterDefaultValue (line 13) | internal static class ParameterDefaultValue
method TryGetDefaultValue (line 17) | [RequiresUnreferencedCode("Unreferenced code may be used")]
class ActivatorHelper (line 71) | public static class ActivatorHelper
method CreateInstance (line 82) | public static T CreateInstance<[DynamicallyAccessedMembers(Dynamically...
method CreateInstance (line 94) | [RequiresUnreferencedCode("Unreferenced code may be used")]
method MatchConstructor (line 108) | private static ConstructorMatcher MatchConstructor(
method MatchBestConstructor (line 153) | [RequiresUnreferencedCode("Unreferenced code may be used")]
method GetBestConstructorArguments (line 159) | [RequiresUnreferencedCode("Unreferenced code may be used")]
method CreateFactory (line 177) | [RequiresUnreferencedCode("Unreferenced code may be used")]
method CreateInstance (line 200) | [RequiresUnreferencedCode("Unreferenced code may be used")]
method GetServiceOrCreateInstance (line 212) | [RequiresUnreferencedCode("Unreferenced code may be used")]
method GetServiceOrCreateInstance (line 224) | [RequiresUnreferencedCode("Unreferenced code may be used")]
method GetMethodInfo (line 230) | private static MethodInfo GetMethodInfo<T>(Expression<T> expr)
method GetService (line 236) | private static object? GetService(IServiceProvider sp, Type type, Type...
method BuildFactoryExpression (line 247) | [RequiresUnreferencedCode("Unreferenced code may be used")]
method FindApplicableConstructor (line 290) | [RequiresUnreferencedCode("Unreferenced code may be used")]
method TryFindMatchingConstructor (line 308) | [RequiresUnreferencedCode("Unreferenced code may be used")]
method TryCreateParameterMap (line 339) | private static bool TryCreateParameterMap(ParameterInfo[] constructorP...
type ConstructorMatcher (line 373) | private readonly struct ConstructorMatcher
method ConstructorMatcher (line 379) | public ConstructorMatcher(ConstructorInfo constructor)
method Match (line 387) | public int Match(object?[] givenParameters)
method CreateInstance (line 422) | [RequiresUnreferencedCode("Unreferenced code may be used")]
method GetConstructorArguments (line 460) | [RequiresUnreferencedCode("Unreferenced code may be used")]
FILE: src/WeihanLi.Common/Helpers/ApplicationHelper.cs
class ApplicationHelper (line 11) | public static class ApplicationHelper
method MapPath (line 21) | public static string MapPath(string virtualPath) => Path.Combine(AppRo...
method GetLibraryInfo (line 28) | public static LibraryInfo GetLibraryInfo(Type type) => GetLibraryInfo(...
method GetLibraryInfo (line 35) | public static LibraryInfo GetLibraryInfo(Assembly assembly)
method GetDotnetPath (line 72) | public static string? GetDotnetPath()
method GetDotnetDirectory (line 95) | public static string GetDotnetDirectory()
method ResolvePath (line 118) | public static string? ResolvePath(string execName) => ResolvePath(exec...
method ResolvePath (line 120) | public static string? ResolvePath(string execName, string? windowsExt)
method GetRuntimeInfo (line 141) | private static RuntimeInfo GetRuntimeInfo()
method IsInContainer (line 188) | private static bool IsInContainer()
method IsInKubernetesCluster (line 209) | private static bool IsInKubernetesCluster()
method GetKubernetesNamespace (line 232) | private static string? GetKubernetesNamespace()
class LibraryInfo (line 240) | public class LibraryInfo
class RuntimeInfo (line 249) | public class RuntimeInfo
FILE: src/WeihanLi.Common/Helpers/ArrayHelper.cs
class ArrayHelper (line 3) | public static class ArrayHelper
method Empty (line 5) | public static T[] Empty<T>() => System.Array.Empty<T>();
FILE: src/WeihanLi.Common/Helpers/AsyncLock.cs
class AsyncLock (line 6) | public sealed class AsyncLock : IDisposable
method Lock (line 10) | public IDisposable Lock()
method LockAsync (line 16) | public Task<IDisposable> LockAsync() => LockAsync(CancellationToken.No...
method LockAsync (line 18) | public Task<IDisposable> LockAsync(CancellationToken cancellationToken...
method LockAsync (line 20) | public async Task<IDisposable> LockAsync(TimeSpan timeout, Cancellatio...
method Dispose (line 33) | public void Dispose()
type AsyncLockReleaser (line 40) | private readonly struct AsyncLockReleaser(SemaphoreSlim semaphoreSlim)...
method Dispose (line 44) | public void Dispose()
FILE: src/WeihanLi.Common/Helpers/Base32EncodeHelper.cs
class Base32EncodeHelper (line 9) | public static class Base32EncodeHelper
method GetBytes (line 17) | public static byte[] GetBytes(string base32String, char paddingChar = ...
method FromBytes (line 55) | public static string FromBytes(byte[] base32Bytes, char paddingChar = ...
method CharToValue (line 94) | private static int CharToValue(char c)
method ValueToChar (line 109) | private static char ValueToChar(byte b)
FILE: src/WeihanLi.Common/Helpers/Base64UrlEncodeHelper.cs
class Base64UrlEncodeHelper (line 6) | public static class Base64UrlEncodeHelper
method Encode (line 23) | public static string Encode(string arg)
method Encode (line 38) | public static string Encode(byte[] inArray, int offset, int length)
method Encode (line 52) | public static string Encode(byte[] inArray)
method DecodeBytes (line 62) | public static byte[] DecodeBytes(string str)
method Decode (line 86) | public static string Decode(string arg)
FILE: src/WeihanLi.Common/Helpers/BoundedConcurrentQueue.cs
class BoundedConcurrentQueue (line 6) | public sealed class BoundedConcurrentQueue<T>
method BoundedConcurrentQueue (line 14) | public BoundedConcurrentQueue()
method BoundedConcurrentQueue (line 20) | public BoundedConcurrentQueue(int queueLimit, BoundedQueueFullMode mod...
method TryDequeue (line 31) | public bool TryDequeue([MaybeNullWhen(false)] out T item)
method TryEnqueue (line 47) | public bool TryEnqueue(T item)
method ToArray (line 82) | public T[] ToArray() => _queue.ToArray();
type BoundedQueueFullMode (line 85) | public enum BoundedQueueFullMode
FILE: src/WeihanLi.Common/Helpers/BuildProcess.cs
type IBuildProcessBuilder (line 9) | public interface IBuildProcessBuilder
method WithTask (line 11) | IBuildProcessBuilder WithTask(string name, Action<IBuildTaskBuilder> b...
method WithSetup (line 13) | IBuildProcessBuilder WithSetup(Func<Task> setupFunc);
method WithCleanup (line 15) | IBuildProcessBuilder WithCleanup(Func<Task> cleanupFunc);
method WithCancelled (line 17) | IBuildProcessBuilder WithCancelled(Func<Task> cancelledFunc);
method WithTaskExecuting (line 19) | IBuildProcessBuilder WithTaskExecuting(Func<IBuildTaskDescriptor, Task...
method WithTaskExecuted (line 21) | IBuildProcessBuilder WithTaskExecuted(Func<IBuildTaskDescriptor, Task>...
type IBuildTaskDescriptor (line 24) | public interface IBuildTaskDescriptor
type IBuildTaskBuilder (line 30) | public interface IBuildTaskBuilder
method WithDescription (line 32) | IBuildTaskBuilder WithDescription(string? description);
method WithDependency (line 33) | IBuildTaskBuilder WithDependency(string dependencyTaskName);
method WithExecution (line 34) | IBuildTaskBuilder WithExecution(Func<CancellationToken, Task> execution);
class BuildProcessExtensions (line 37) | public static class BuildProcessExtensions
method extension (line 39) | extension(IBuildProcessBuilder builder)
method extension (line 56) | extension(IBuildTaskBuilder builder)
method extension (line 62) | extension(BuildProcess)
method extension (line 67) | extension(DotNetBuildProcessOptions options)
class BuildProcess (line 76) | public sealed class BuildProcess(IReadOnlyCollection<BuildTask> tasks,
method ExecuteAsync (line 84) | public async Task ExecuteAsync(string target, CancellationToken cancel...
method ExecuteTask (line 109) | private async Task ExecuteTask(BuildTask task, CancellationToken cance...
class BuildTask (line 124) | public sealed class BuildTask(string name, string? description, Func<Can...
method SetDependencies (line 133) | internal void SetDependencies(IReadOnlyCollection<BuildTask> dependenc...
method ExecuteAsync (line 138) | public Task ExecuteAsync(CancellationToken cancellationToken) =>
class BuildTaskBuilder (line 142) | internal sealed class BuildTaskBuilder(string name) : IBuildTaskBuilder
method WithDescription (line 150) | public IBuildTaskBuilder WithDescription(string? description)
method WithExecution (line 156) | public IBuildTaskBuilder WithExecution(Func<CancellationToken, Task> e...
method WithDependency (line 162) | public IBuildTaskBuilder WithDependency(string dependencyTaskName)
method Build (line 173) | internal BuildTask Build()
class BuildProcessBuilder (line 179) | internal sealed class BuildProcessBuilder : IBuildProcessBuilder
method WithTask (line 185) | public IBuildProcessBuilder WithTask(string name, Action<IBuildTaskBui...
method WithSetup (line 203) | public IBuildProcessBuilder WithSetup(Func<Task> setupFunc)
method WithCleanup (line 209) | public IBuildProcessBuilder WithCleanup(Func<Task> cleanupFunc)
method WithCancelled (line 215) | public IBuildProcessBuilder WithCancelled(Func<Task> cancelledFunc)
method WithTaskExecuting (line 221) | public IBuildProcessBuilder WithTaskExecuting(Func<IBuildTaskDescripto...
method WithTaskExecuted (line 227) | public IBuildProcessBuilder WithTaskExecuted(Func<IBuildTaskDescriptor...
method Build (line 233) | public BuildProcess Build()
class DotNetBuildProcessOptions (line 269) | public sealed class DotNetBuildProcessOptions
method WithTaskConfigure (line 283) | public DotNetBuildProcessOptions WithTaskConfigure(string name, Action...
method WithTaskExecution (line 289) | public DotNetBuildProcessOptions WithTaskExecution(string name, Func<C...
FILE: src/WeihanLi.Common/Helpers/Combinatorics/Combinations.cs
class Combinations (line 32) | public sealed class Combinations<T> : IEnumerable<IReadOnlyList<T>>
method Combinations (line 41) | public Combinations(IEnumerable<T> values, int lowerIndex)
method Combinations (line 53) | public Combinations(IEnumerable<T> values, int lowerIndex, GenerateOpt...
method GetEnumerator (line 96) | public IEnumerator<IReadOnlyList<T>> GetEnumerator() => new Enumerator...
method GetEnumerator (line 98) | IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
class Enumerator (line 103) | private sealed class Enumerator : IEnumerator<IReadOnlyList<T>>
method Enumerator (line 109) | public Enumerator(Combinations<T> source)
method Reset (line 115) | void IEnumerator.Reset() => throw new NotSupportedException();
method MoveNext (line 125) | public bool MoveNext()
method Dispose (line 147) | public void Dispose() => _myPermutationsEnumerator.Dispose();
method ComputeCurrent (line 175) | private void ComputeCurrent()
FILE: src/WeihanLi.Common/Helpers/Combinatorics/GenerateOption.cs
type GenerateOption (line 6) | public enum GenerateOption
FILE: src/WeihanLi.Common/Helpers/Combinatorics/Permutations.cs
class Permutations (line 27) | public sealed class Permutations<T> : IEnumerable<IReadOnlyList<T>>
method Permutations (line 36) | public Permutations(IEnumerable<T> values)
method Permutations (line 48) | public Permutations(IEnumerable<T> values, GenerateOption type)
method Permutations (line 60) | public Permutations(IEnumerable<T> values, IComparer<T>? comparer)
method Permutations (line 72) | public Permutations(IEnumerable<T> values, GenerateOption type, ICompa...
method GetEnumerator (line 135) | public IEnumerator<IReadOnlyList<T>> GetEnumerator() => new Enumerator...
method GetEnumerator (line 137) | IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
class Enumerator (line 142) | internal sealed class Enumerator : IEnumerator<IReadOnlyList<T>>
method Enumerator (line 148) | public Enumerator(Permutations<T> source)
method Reset (line 157) | void IEnumerator.Reset() => throw new NotSupportedException();
method MoveNext (line 168) | public bool MoveNext()
method Dispose (line 214) | public void Dispose()
method NextPermutation (line 230) | private bool NextPermutation()
method Swap (line 269) | private void Swap(int i, int j)
type Position (line 307) | private enum Position
method GetCount (line 346) | private BigInteger GetCount()
FILE: src/WeihanLi.Common/Helpers/Combinatorics/SmallPrimeUtility.cs
class SmallPrimeUtility (line 14) | internal static class SmallPrimeUtility
method Factor (line 23) | public static List<int> Factor(int i)
method DividePrimeFactors (line 59) | public static List<int> DividePrimeFactors(IEnumerable<int> numerator,...
method EvaluatePrimeFactors (line 73) | public static BigInteger EvaluatePrimeFactors(IEnumerable<int> value)
method SmallPrimeUtility (line 85) | static SmallPrimeUtility()
method CalculatePrimes (line 96) | private static IReadOnlyList<int> CalculatePrimes()
FILE: src/WeihanLi.Common/Helpers/Combinatorics/Variations.cs
class Variations (line 22) | public sealed class Variations<T> : IEnumerable<IReadOnlyList<T>>
method Variations (line 31) | public Variations(IEnumerable<T> values, int lowerIndex)
method Variations (line 43) | public Variations(IEnumerable<T> values, int lowerIndex, GenerateOptio...
method GetEnumerator (line 66) | public IEnumerator<IReadOnlyList<T>> GetEnumerator() =>
method GetEnumerator (line 71) | IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
class EnumeratorWithRepetition (line 80) | private sealed class EnumeratorWithRepetition(Variations<T> source) : ...
method Reset (line 82) | void IEnumerator.Reset() => throw new NotSupportedException();
method MoveNext (line 93) | public bool MoveNext()
method Dispose (line 140) | public void Dispose()
method ComputeCurrent (line 147) | private void ComputeCurrent()
class EnumeratorWithoutRepetition (line 180) | private sealed class EnumeratorWithoutRepetition : IEnumerator<IReadOn...
method EnumeratorWithoutRepetition (line 186) | public EnumeratorWithoutRepetition(Variations<T> source)
method Reset (line 192) | void IEnumerator.Reset() => throw new NotSupportedException();
method MoveNext (line 198) | public bool MoveNext()
method Dispose (line 220) | public void Dispose() => _myPermutationsEnumerator.Dispose();
method ComputeCurrent (line 237) | private void ComputeCurrent()
FILE: src/WeihanLi.Common/Helpers/CommandExecutor.cs
class CommandExecutor (line 9) | public static class CommandExecutor
method ExecuteCommand (line 20) | public static int ExecuteCommand(string command, string? workingDirect...
method ExecuteCommandAndCapture (line 34) | public static CommandResult ExecuteCommandAndCapture(string command, s...
method ExecuteCommandAndOutput (line 50) | public static int ExecuteCommandAndOutput(string command,
method ExecuteCommandAsync (line 67) | public static Task<int> ExecuteCommandAsync(string command, string? wo...
method ExecuteCommandAndCaptureAsync (line 82) | public static Task<CommandResult> ExecuteCommandAndCaptureAsync(string...
method ExecuteCommandAndOutputAsync (line 100) | public static Task<int> ExecuteCommandAndOutputAsync(string command, s...
method Execute (line 117) | public static int Execute(string commandPath, string? arguments = null...
method ExecuteAsync (line 138) | public static async Task<int> ExecuteAsync(string commandPath, string?...
method ExecuteAndOutput (line 160) | public static int ExecuteAndOutput(string commandPath, string? argumen...
method ExecuteAndOutputAsync (line 185) | public static async Task<int> ExecuteAndOutputAsync(string commandPath...
method ExecuteAndCapture (line 207) | public static CommandResult ExecuteAndCapture(string commandPath, stri...
method ExecuteAndCapture (line 224) | public static CommandResult ExecuteAndCapture(this ProcessStartInfo pr...
method ExecuteAndCaptureAsync (line 238) | public static Task<CommandResult> ExecuteAndCaptureAsync(string comman...
method ExecuteAndCaptureAsync (line 256) | public static async Task<CommandResult> ExecuteAndCaptureAsync(this Pr...
class CommandResult (line 262) | public sealed class CommandResult(int exitCode, string standardOut, stri...
method EnsureSuccessExitCode (line 269) | public CommandResult EnsureSuccessExitCode(int successCode = 0)
FILE: src/WeihanLi.Common/Helpers/CommandLineParser.cs
class CommandLineParser (line 9) | public static class CommandLineParser
method ParseLine (line 11) | public static IEnumerable<string> ParseLine(string line, LineParseOpti...
method Val (line 99) | [return: NotNullIfNotNull(nameof(defaultValue))]
method Val (line 112) | [return: NotNullIfNotNull(nameof(defaultValue))]
method Val (line 125) | [return: NotNullIfNotNull(nameof(defaultValue))]
method BooleanVal (line 138) | public static bool BooleanVal(string optionName, string[]? args = null...
method BooleanVal (line 150) | public static bool BooleanVal(string optionName, bool defaultValue, st...
method BooleanVal (line 162) | public static bool BooleanVal(string[] args, string optionName, bool d...
method GetValueInternal (line 167) | private static string? GetValueInternal(string[] args, string argument...
class LineParseOptions (line 194) | public sealed class LineParseOptions
FILE: src/WeihanLi.Common/Helpers/ConcurrentSet.cs
class ConcurrentSet (line 6) | public sealed class ConcurrentSet<T> : IReadOnlyCollection<T>, ICollecti...
method Contains (line 17) | public bool Contains(T item) => _dictionary.ContainsKey(item);
method TryAdd (line 19) | public bool TryAdd(T t) => _dictionary.TryAdd(t, default);
method TryRemove (line 21) | public bool TryRemove(T t) => _dictionary.TryRemove(t, out _);
method Values (line 23) | public ICollection<T> Values() => _dictionary.Keys;
method Clear (line 25) | public void Clear() => _dictionary.Clear();
method GetEnumerator (line 27) | public IEnumerator<T> GetEnumerator()
method GetEnumerator (line 32) | IEnumerator IEnumerable.GetEnumerator()
method Add (line 37) | public void Add(T item)
method CopyTo (line 42) | public void CopyTo(T[] array, int arrayIndex)
method Remove (line 47) | public bool Remove(T item)
FILE: src/WeihanLi.Common/Helpers/ConsoleHelper.cs
class ConsoleHelper (line 8) | public static class ConsoleHelper
method InvokeWithConsoleColor (line 13) | public static void InvokeWithConsoleColor(Action action, ConsoleColor?...
method InvokeWithConsoleColor (line 40) | public static async Task InvokeWithConsoleColor(Func<Task> action, Con...
method WriteWithColor (line 67) | public static void WriteWithColor(string? output, ConsoleColor? foregr...
method WriteLineWithColor (line 83) | public static void WriteLineWithColor(string? output, ConsoleColor? fo...
method ErrorWriteWithColor (line 101) | public static void ErrorWriteWithColor(string? output, ConsoleColor? f...
method ErrorWriteLineWithColor (line 117) | public static void ErrorWriteLineWithColor(string? error, ConsoleColor...
method GetInput (line 135) | public static string? GetInput(string? inputPrompt = null, bool insert...
method HandleInputLoopAsync (line 145) | public static async Task HandleInputLoopAsync(Func<string, Task<bool>>...
method HandleInputLoopAsync (line 161) | public static async Task HandleInputLoopAsync(Func<string, Task> handler,
method HandleInputLoop (line 174) | public static void HandleInputLoop(Func<string, bool> handler,
method HandleInputLoop (line 190) | public static void HandleInputLoop(Action<string> handler,
method ReadLineWithPrompt (line 203) | public static string? ReadLineWithPrompt(string? prompt = "Press Enter...
method ReadKeyWithPrompt (line 209) | public static ConsoleKeyInfo ReadKeyWithPrompt(string? prompt = "Press...
method WriteLineIf (line 215) | public static void WriteLineIf(string? output, bool condition)
method WriteIf (line 220) | public static void WriteIf(string? output, bool condition)
method ErrorWriteLineIf (line 225) | public static void ErrorWriteLineIf(string? output, bool condition)
method ErrorWriteIf (line 230) | public static void ErrorWriteIf(string? output, bool condition)
method PrintOutputToConsole (line 235) | public static CommandResult PrintOutputToConsole(this CommandResult co...
method HasStandardInput (line 250) | public static bool HasStandardInput()
method TryGetStandardInput (line 255) | public static bool TryGetStandardInput([MaybeNullWhen(false)] out stri...
method SupportsAnsiColors (line 271) | public static bool SupportsAnsiColors() => _supportsAnsiColors.Value;
method DetectAnsiColorSupport (line 273) | private static bool DetectAnsiColorSupport()
method ApplyAnsiColor (line 319) | private static string ApplyAnsiColor(string text, ConsoleColor? foregr...
method GetAnsiColorCode (line 349) | private static int GetAnsiColorCode(ConsoleColor color, bool isForegro...
FILE: src/WeihanLi.Common/Helpers/ConsoleOutput.cs
class ConsoleOutput (line 6) | public sealed class ConsoleOutput : IDisposable
method ConsoleOutput (line 20) | private ConsoleOutput()
method Capture (line 24) | public static ConsoleOutput Capture()
method CaptureAsync (line 30) | public static async Task<ConsoleOutput> CaptureAsync()
method Dispose (line 36) | public void Dispose()
method Clear (line 59) | public void Clear()
method GetConsoleOutputInternal (line 65) | private static ConsoleOutput GetConsoleOutputInternal()
FILE: src/WeihanLi.Common/Helpers/ContextAccessor.cs
class ContextAccessor (line 6) | public sealed class ContextAccessor<TContext> where TContext : class
class ContextHolder (line 36) | private sealed class ContextHolder<TContext1> where TContext1 : class
FILE: src/WeihanLi.Common/Helpers/ConvertHelper.cs
class ConvertHelper (line 5) | public static class ConvertHelper
method ToEndPoint (line 7) | public static EndPoint ToEndPoint(string ipOrHost, int port)
FILE: src/WeihanLi.Common/Helpers/Cron/CalendarHelper.cs
class CalendarHelper (line 9) | internal static class CalendarHelper
method IsGreaterThan (line 46) | [MethodImpl(MethodImplOptions.AggressiveInlining)]
method DateTimeToTicks (line 55) | [MethodImpl(MethodImplOptions.AggressiveInlining)]
method FillDateTimeParts (line 66) | [MethodImpl(MethodImplOptions.AggressiveInlining)]
method GetDayOfWeek (line 113) | [MethodImpl(MethodImplOptions.AggressiveInlining)]
method GetDaysInMonth (line 125) | [MethodImpl(MethodImplOptions.AggressiveInlining)]
method MoveToNearestWeekDay (line 133) | [MethodImpl(MethodImplOptions.AggressiveInlining)]
method IsNthDayOfWeek (line 149) | [MethodImpl(MethodImplOptions.AggressiveInlining)]
method IsLastDayOfWeek (line 156) | [MethodImpl(MethodImplOptions.AggressiveInlining)]
FILE: src/WeihanLi.Common/Helpers/Cron/CronExpression.cs
method CronExpression (line 79) | private CronExpression()
method Parse (line 90) | public static CronExpression Parse(string expression)
method Parse (line 103) | [MethodImpl(MethodImplOptions.AggressiveInlining)]
method GetNextOccurrence (line 166) | public DateTimeOffset? GetNextOccurrence(DateTimeOffset from, TimeZoneIn...
method GetOccurrences (line 185) | public IEnumerable<DateTimeOffset> GetOccurrences(
method ToString (line 204) | public override string ToString()
method Equals (line 225) | public bool Equals(CronExpression other)
method Equals (line 248) | public override bool Equals(object obj) => Equals(obj as CronExpression);
method GetHashCode (line 257) | [SuppressMessage("ReSharper", "NonReadonlyMemberInGetHashCode")]
method GetOccurenceByZonedTimes (line 286) | private DateTimeOffset? GetOccurenceByZonedTimes(DateTimeOffset from, Ti...
method FindOccurence (line 341) | private long FindOccurence(long startTimeTicks, long endTimeTicks, bool ...
method FindOccurence (line 349) | private long FindOccurence(long ticks, bool startInclusive)
method Move (line 419) | private static bool Move(long fieldBits, ref int fieldValue)
method GetLastDayOfMonth (line 431) | private int GetLastDayOfMonth(int year, int month)
method IsDayOfWeekMatch (line 436) | private bool IsDayOfWeekMatch(int year, int month, int day)
method GetFirstSet (line 451) | [MethodImpl(MethodImplOptions.AggressiveInlining)]
method HasFlag (line 458) | private bool HasFlag(CronExpressionFlag value)
method SkipWhiteSpaces (line 463) | [MethodImpl(MethodImplOptions.AggressiveInlining)]
method ParseWhiteSpace (line 469) | [MethodImpl(MethodImplOptions.AggressiveInlining)]
method ParseEndOfString (line 476) | [MethodImpl(MethodImplOptions.AggressiveInlining)]
FILE: src/WeihanLi.Common/Helpers/Cron/CronExpressionFlag.cs
type CronExpressionFlag (line 25) | [Flags]
FILE: src/WeihanLi.Common/Helpers/Cron/CronField.cs
class CronField (line 27) | internal sealed class CronField
method CronField (line 51) | static CronField()
method CronField (line 87) | private CronField(string name, int first, int last, int[] names, bool ...
method ToString (line 100) | public override string ToString()
FILE: src/WeihanLi.Common/Helpers/Cron/CronFormat.cs
type CronFormat (line 28) | public enum CronFormat : byte
FILE: src/WeihanLi.Common/Helpers/Cron/CronFormatException.cs
class CronFormatException (line 32) | [Serializable]
method CronFormatException (line 35) | internal CronFormatException(CronField field, string message) : this($...
FILE: src/WeihanLi.Common/Helpers/Cron/TimeZoneHelper.cs
class TimeZoneHelper (line 25) | internal static class TimeZoneHelper
method IsAmbiguousTime (line 34) | public static bool IsAmbiguousTime(TimeZoneInfo zone, DateTime ambiguo...
method GetDaylightOffset (line 39) | public static TimeSpan GetDaylightOffset(TimeZoneInfo zone, DateTime a...
method GetDaylightTimeStart (line 49) | public static DateTimeOffset GetDaylightTimeStart(TimeZoneInfo zone, D...
method GetStandardTimeStart (line 64) | public static DateTimeOffset GetStandardTimeStart(TimeZoneInfo zone, D...
method GetAmbiguousIntervalEnd (line 71) | public static DateTimeOffset GetAmbiguousIntervalEnd(TimeZoneInfo zone...
method GetDaylightTimeEnd (line 78) | public static DateTimeOffset GetDaylightTimeEnd(TimeZoneInfo zone, Dat...
method GetAmbiguousOffsets (line 85) | private static TimeSpan[] GetAmbiguousOffsets(TimeZoneInfo zone, DateT...
method GetDstTransitionEndDateTime (line 90) | private static DateTime GetDstTransitionEndDateTime(TimeZoneInfo zone,...
FILE: src/WeihanLi.Common/Helpers/CronHelper.cs
class CronHelper (line 9) | public static class CronHelper
method GetNextOccurrence (line 24) | public static DateTimeOffset? GetNextOccurrence(string cron)
method GetNextOccurrence (line 36) | public static DateTimeOffset? GetNextOccurrence(string cron, TimeZoneI...
method GetNextOccurrences (line 48) | public static IEnumerable<DateTimeOffset> GetNextOccurrences(string cr...
method GetNextOccurrences (line 62) | public static IEnumerable<DateTimeOffset> GetNextOccurrences(string cr...
FILE: src/WeihanLi.Common/Helpers/DataSerializer.cs
type IDataSerializer (line 8) | public interface IDataSerializer
method Serialize (line 16) | [RequiresUnreferencedCode("Members from serialized types may be trimme...
method Deserialize (line 25) | [RequiresUnreferencedCode("Members from serialized types may be trimme...
class XmlDataSerializer (line 29) | public class XmlDataSerializer : IDataSerializer
method Serialize (line 33) | [RequiresUnreferencedCode("Members from serialized types may be trimme...
method Deserialize (line 47) | [RequiresUnreferencedCode("If some of the generic arguments are annota...
class JsonDataSerializer (line 62) | public class JsonDataSerializer : IDataSerializer
method Serialize (line 64) | [RequiresUnreferencedCode("Members from serialized types may be trimme...
method Deserialize (line 75) | [RequiresUnreferencedCode("Members from serialized types may be trimme...
class CompressDataSerializer (line 87) | public sealed class CompressDataSerializ
Condensed preview — 445 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (2,390K chars).
[
{
"path": ".config/dotnet-tools.json",
"chars": 145,
"preview": "{\n \"version\": 1,\n \"isRoot\": true,\n \"tools\": {\n \"husky\": {\n \"version\": \"0.6.4\",\n \"commands\": [\n \"h"
},
{
"path": ".copilot-instructions.md",
"chars": 8720,
"preview": "# WeihanLi.Common - Copilot Instructions\n\n## Project Overview\n\nWeihanLi.Common is a comprehensive .NET utility library p"
},
{
"path": ".devcontainer/devcontainer.json",
"chars": 728,
"preview": "{\n \"name\": \"CodeSpace\",\n \"image\": \"mcr.microsoft.com/devcontainers/base:debian\",\n \"postCreateCommand\": \"bash -i"
},
{
"path": ".devcontainer/scripts/post-creation.sh",
"chars": 105,
"preview": "dotnet tool install -g dotnet-execute --prereleaase\ndotnet tool install -g dotnet-httpie\n\ndotnet restore\n"
},
{
"path": ".editorconfig",
"chars": 55536,
"preview": "# EditorConfig is awesome:http://EditorConfig.org\n\n# top-most EditorConfig file\nroot = true\n\n# Don't use tabs for indent"
},
{
"path": ".gitattributes",
"chars": 2556,
"preview": "###############################################################################\n# Set default behavior to automatically "
},
{
"path": ".github/workflows/copilot-setup-steps.yml",
"chars": 1376,
"preview": "name: \"Copilot Setup Steps\"\n\n# Automatically run the setup steps when they are changed to allow for easy validation, and"
},
{
"path": ".github/workflows/default.yml",
"chars": 731,
"preview": "name: default\n\non:\n push:\n branches:\n - \"main\"\n - \"master\"\n - \"dev\"\n pull_request:\n # The branche"
},
{
"path": ".github/workflows/docfx.yml",
"chars": 699,
"preview": "name: docs\non:\n push:\n branches:\n - main\n - master\njobs:\n build:\n name: Build\n runs-on: windows-lat"
},
{
"path": ".github/workflows/dotnet-format.yml",
"chars": 1129,
"preview": "name: dotnet-format\n\non:\n push:\n branches:\n - \"dev\"\n\njobs:\n build:\n runs-on: ubuntu-latest\n steps:\n -"
},
{
"path": ".github/workflows/release.yml",
"chars": 724,
"preview": "name: Release\non:\n workflow_dispatch:\n push:\n branches: [ master ]\njobs:\n build:\n name: Release\n runs-on: wi"
},
{
"path": ".gitignore",
"chars": 4905,
"preview": "## Ignore Visual Studio temporary files, build results, and\n## files generated by popular Visual Studio add-ons.\n##\n## G"
},
{
"path": ".husky/commit-msg",
"chars": 186,
"preview": "#!/bin/sh\n. \"$(dirname \"$0\")/_/husky.sh\"\n\n# dotnet tool update -g dotnet-execute --prerelease\n# dotnet husky run --name "
},
{
"path": ".husky/post-push",
"chars": 513,
"preview": "#!/bin/sh\n. \"$(dirname \"$0\")/_/husky.sh\"\n\n## husky task runner examples -------------------\n## Note : for local installa"
},
{
"path": ".husky/pre-commit",
"chars": 297,
"preview": "#!/bin/sh\n. \"$(dirname \"$0\")/_/husky.sh\"\n\n# task-runner config https://alirezanet.github.io/Husky.Net/guide/task-runner."
},
{
"path": ".husky/pre-push",
"chars": 78,
"preview": "#!/bin/sh\n. \"$(dirname \"$0\")/_/husky.sh\"\n\n# dotnet husky run --group pre-push\n"
},
{
"path": ".husky/scripts/commit-lint.cs",
"chars": 883,
"preview": "/*\nA simple regex commit linter\nhttps://www.conventionalcommits.org/en/v1.0.0/\nhttps://github.com/angular/angular/blob/2"
},
{
"path": ".husky/task-runner.json",
"chars": 562,
"preview": "{\n \"tasks\": \n [\n {\n \"name\": \"commit-message-linter\",\n \"group\": \"commit-msg\",\n \"command\": \"dotnet-exe"
},
{
"path": "AGENTS.md",
"chars": 10950,
"preview": "# AGENTS.md — WeihanLi.Common\n\nThis file gives AI coding agents the context needed to work on this repository effectivel"
},
{
"path": "Directory.Build.props",
"chars": 849,
"preview": "<Project>\n <Import Project=\"./build/version.props\" />\n <PropertyGroup>\n <LatestTargetFramework>net10.0</LatestTarge"
},
{
"path": "Directory.Build.targets",
"chars": 21,
"preview": "<Project>\n</Project>\n"
},
{
"path": "Directory.Packages.props",
"chars": 3223,
"preview": "<Project>\n <PropertyGroup>\n <!-- Enable central package management -->\n <ManagePackageVersionsCentrally>true</Man"
},
{
"path": "LICENSE",
"chars": 11305,
"preview": "Apache License\n Version 2.0, January 2004\n http://www.apache.org/licens"
},
{
"path": "README.md",
"chars": 4528,
"preview": "# WeihanLi.Common\n\n[](https://www.nu"
},
{
"path": "WeihanLi.Common.sln.DotSettings",
"chars": 815,
"preview": "<wpf:ResourceDictionary xml:space=\"preserve\" xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\" xmlns:s=\"clr-namesp"
},
{
"path": "WeihanLi.Common.slnx",
"chars": 735,
"preview": "<Solution>\n <Folder Name=\"/perf/\">\n <Project Path=\"perf/WeihanLi.Common.Benchmark/WeihanLi.Common.Benchmark.csproj\" "
},
{
"path": "azure-pipelines.yml",
"chars": 1479,
"preview": "# https://learn.microsoft.com/en-us/azure/devops/pipelines/yaml-schema/pr?view=azure-pipelines\npr: none\n\ntrigger:\n bran"
},
{
"path": "build/exportReleaseVersion.cs",
"chars": 826,
"preview": "var currentDirectory = Directory.GetCurrentDirectory();\nConsole.WriteLine($\"currentDirectory: {currentDirectory}\");\n\nvar"
},
{
"path": "build/sign.props",
"chars": 299,
"preview": "<Project>\n <PropertyGroup Condition=\"'$(OS)' == 'Windows_NT' and '$(Configuration)' == 'Release'\">\n <SignAssembly>Tr"
},
{
"path": "build/version.props",
"chars": 247,
"preview": "<Project>\n <PropertyGroup>\n <VersionMajor>1</VersionMajor>\n <VersionMinor>0</VersionMinor>\n <VersionPatch>88</"
},
{
"path": "build.cs",
"chars": 860,
"preview": "// Copyright (c) Weihan Li. All rights reserved.\n// Licensed under the Apache license version 2.0 http://www.apache.org"
},
{
"path": "docs/.gitignore",
"chars": 106,
"preview": "###############\n# folder #\n###############\n/**/DROP/\n/**/TEMP/\n/**/packages/\n/**/bin/\n/**/obj/\n_site\n"
},
{
"path": "docs/ReleaseNotes.md",
"chars": 9862,
"preview": "# Package Release Notes\n\n## WeihanLi.Common\n\nSee pull requests list for changes <https://github.com/WeihanLi/WeihanLi.Co"
},
{
"path": "docs/api/.gitignore",
"chars": 64,
"preview": "###############\n# temp file #\n###############\n*.yml\n.manifest\n"
},
{
"path": "docs/api/index.md",
"chars": 117,
"preview": "# PLACEHOLDER\n\nTODO: Add .NET projects to the *src* folder and run `docfx` to generate **REAL** *API Documentation*!\n"
},
{
"path": "docs/articles/intro.md",
"chars": 31,
"preview": "# Add your introductions here!\n"
},
{
"path": "docs/articles/toc.yml",
"chars": 38,
"preview": "- name: Introduction\n href: intro.md\n"
},
{
"path": "docs/docfx.json",
"chars": 1151,
"preview": "{\n \"metadata\": [\n {\n \"src\": [\n {\n \"files\": [\n \"src/**.csproj\"\n ],\n "
},
{
"path": "docs/index.md",
"chars": 1292,
"preview": "# WeihanLi.Common\n\n## Build status\n\n[, 1 CPU, 4 logical and"
},
{
"path": "perf/WeihanLi.Common.Benchmark/BenchmarkDotNet.Artifacts/results/CreateInstanceTest-report.csv",
"chars": 1624,
"preview": "Method,Job,AnalyzeLaunchVariance,EvaluateOverhead,MaxAbsoluteError,MaxRelativeError,MinInvokeCount,MinIterationTime,Remo"
},
{
"path": "perf/WeihanLi.Common.Benchmark/BenchmarkDotNet.Artifacts/results/CreateInstanceTest-report.html",
"chars": 1293,
"preview": "<!DOCTYPE html>\n<html lang='en'>\n<head>\n<meta charset='utf-8' />\n<title>CreateInstanceTest</title>\n\n<style type=\"text/cs"
},
{
"path": "perf/WeihanLi.Common.Benchmark/BenchmarkDotNet.Artifacts/results/DITest-report-github.md",
"chars": 1813,
"preview": "``` ini\n\nBenchmarkDotNet=v0.10.14, OS=Windows 10.0.18362\nIntel Core i5-6300U CPU 2.40GHz (Skylake), 1 CPU, 4 logical and"
},
{
"path": "perf/WeihanLi.Common.Benchmark/BenchmarkDotNet.Artifacts/results/DITest-report.csv",
"chars": 2771,
"preview": "Method,Job,AnalyzeLaunchVariance,EvaluateOverhead,MaxAbsoluteError,MaxRelativeError,MinInvokeCount,MinIterationTime,Remo"
},
{
"path": "perf/WeihanLi.Common.Benchmark/BenchmarkDotNet.Artifacts/results/DITest-report.html",
"chars": 2432,
"preview": "<!DOCTYPE html>\n<html lang='en'>\n<head>\n<meta charset='utf-8' />\n<title>DITest</title>\n\n<style type=\"text/css\">\n\ttable {"
},
{
"path": "perf/WeihanLi.Common.Benchmark/BenchmarkDotNet.Artifacts/results/WeihanLi.Common.Benchmark.DITest-report-github.md",
"chars": 1344,
"preview": "``` ini\n\nBenchmarkDotNet=v0.12.0, OS=Windows 10.0.18362\nIntel Core i5-3470 CPU 3.20GHz (Ivy Bridge), 1 CPU, 4 logical an"
},
{
"path": "perf/WeihanLi.Common.Benchmark/BenchmarkDotNet.Artifacts/results/WeihanLi.Common.Benchmark.DITest-report.csv",
"chars": 2743,
"preview": "Method,Job,AnalyzeLaunchVariance,EvaluateOverhead,MaxAbsoluteError,MaxRelativeError,MinInvokeCount,MinIterationTime,Outl"
},
{
"path": "perf/WeihanLi.Common.Benchmark/BenchmarkDotNet.Artifacts/results/WeihanLi.Common.Benchmark.DITest-report.html",
"chars": 1992,
"preview": "<!DOCTYPE html>\n<html lang='en'>\n<head>\n<meta charset='utf-8' />\n<title>WeihanLi.Common.Benchmark.DITest-20191125-101726"
},
{
"path": "perf/WeihanLi.Common.Benchmark/BenchmarkDotNet.Artifacts/results/WeihanLi.Common.Benchmark.MapperTest-report-github.md",
"chars": 739,
"preview": "``` ini\n\nBenchmarkDotNet=v0.12.1, OS=Windows 10.0.19041.610 (2004/?/20H1)\nIntel Core i5-6300U CPU 2.40GHz (Skylake), 1 C"
},
{
"path": "perf/WeihanLi.Common.Benchmark/BenchmarkDotNet.Artifacts/results/WeihanLi.Common.Benchmark.MapperTest-report.csv",
"chars": 1395,
"preview": "Method,Job,AnalyzeLaunchVariance,EvaluateOverhead,MaxAbsoluteError,MaxRelativeError,MinInvokeCount,MinIterationTime,Outl"
},
{
"path": "perf/WeihanLi.Common.Benchmark/BenchmarkDotNet.Artifacts/results/WeihanLi.Common.Benchmark.MapperTest-report.html",
"chars": 1310,
"preview": "<!DOCTYPE html>\n<html lang='en'>\n<head>\n<meta charset='utf-8' />\n<title>WeihanLi.Common.Benchmark.MapperTest-20201107-23"
},
{
"path": "perf/WeihanLi.Common.Benchmark/BenchmarkDotNet.Artifacts/results/WeihanLi.Common.Benchmark.PipelineTest-report-github.md",
"chars": 941,
"preview": "``` ini\n\nBenchmarkDotNet=v0.13.1, OS=Windows 10.0.22581\nIntel Core i5-6300U CPU 2.40GHz (Skylake), 1 CPU, 4 logical and "
},
{
"path": "perf/WeihanLi.Common.Benchmark/BenchmarkDotNet.Artifacts/results/WeihanLi.Common.Benchmark.PipelineTest-report.csv",
"chars": 2268,
"preview": "Method,Job,AnalyzeLaunchVariance,EvaluateOverhead,MaxAbsoluteError,MaxRelativeError,MinInvokeCount,MinIterationTime,Outl"
},
{
"path": "perf/WeihanLi.Common.Benchmark/BenchmarkDotNet.Artifacts/results/WeihanLi.Common.Benchmark.PipelineTest-report.html",
"chars": 1585,
"preview": "<!DOCTYPE html>\n<html lang='en'>\n<head>\n<meta charset='utf-8' />\n<title>WeihanLi.Common.Benchmark.PipelineTest-20220404-"
},
{
"path": "perf/WeihanLi.Common.Benchmark/DITest.cs",
"chars": 5640,
"preview": "using BenchmarkDotNet.Attributes;\nusing BenchmarkDotNet.Columns;\nusing BenchmarkDotNet.Configs;\nusing BenchmarkDotNet.D"
},
{
"path": "perf/WeihanLi.Common.Benchmark/PipelineTest.cs",
"chars": 2789,
"preview": "// Copyright (c) Weihan Li. All rights reserved.\n// Licensed under the Apache license.\n\nusing BenchmarkDotNet.Attribute"
},
{
"path": "perf/WeihanLi.Common.Benchmark/Program.cs",
"chars": 368,
"preview": "using BenchmarkDotNet.Running;\n\nnamespace WeihanLi.Common.Benchmark;\n\npublic class Program\n{\n public static void Mai"
},
{
"path": "perf/WeihanLi.Common.Benchmark/WeihanLi.Common.Benchmark.csproj",
"chars": 512,
"preview": "<Project Sdk=\"Microsoft.NET.Sdk\">\n\n <PropertyGroup>\n <TargetFramework>$(LatestTargetFramework)</TargetFramework>\n "
},
{
"path": "samples/AspNetCoreSample/AspNetCoreSample.csproj",
"chars": 267,
"preview": "<Project Sdk=\"Microsoft.NET.Sdk.Web\">\n\n <PropertyGroup>\n <TargetFramework>$(LatestTargetFramework)</TargetFramework"
},
{
"path": "samples/AspNetCoreSample/Controllers/EventsController.cs",
"chars": 316,
"preview": "using AspNetCoreSample.Events;\nusing Microsoft.AspNetCore.Mvc;\n\nnamespace AspNetCoreSample.Controllers;\n\n[Route(\"api/[c"
},
{
"path": "samples/AspNetCoreSample/Controllers/HomeController.cs",
"chars": 1133,
"preview": "using AspNetCoreSample.Models;\nusing Microsoft.AspNetCore.Mvc;\nusing System.Diagnostics;\n\nnamespace AspNetCoreSample.Co"
},
{
"path": "samples/AspNetCoreSample/Events/EventConsumer.cs",
"chars": 1459,
"preview": "using WeihanLi.Common;\nusing WeihanLi.Common.Event;\nusing WeihanLi.Extensions;\n\nnamespace AspNetCoreSample.Events;\n\npub"
},
{
"path": "samples/AspNetCoreSample/Events/PageViewEvent.cs",
"chars": 415,
"preview": "using WeihanLi.Common.Event;\n\nnamespace AspNetCoreSample.Events;\n\npublic class PageViewEvent\n{\n public string? Path "
},
{
"path": "samples/AspNetCoreSample/FluentAspectsServiceProviderFactory.cs",
"chars": 1742,
"preview": "using System.Linq.Expressions;\nusing WeihanLi.Common.Aspect;\nusing WeihanLi.Extensions;\n\nnamespace AspNetCoreSample;\n\ni"
},
{
"path": "samples/AspNetCoreSample/LogInterceptor.cs",
"chars": 1593,
"preview": "using System.Diagnostics;\nusing WeihanLi.Common.Aspect;\nusing WeihanLi.Extensions;\n\nnamespace AspNetCoreSample;\n\npublic"
},
{
"path": "samples/AspNetCoreSample/Models/ErrorViewModel.cs",
"chars": 180,
"preview": "namespace AspNetCoreSample.Models;\n\npublic class ErrorViewModel\n{\n public string? RequestId { get; set; }\n\n publi"
},
{
"path": "samples/AspNetCoreSample/Program.cs",
"chars": 966,
"preview": "using WeihanLi.Common.Aspect;\nusing WeihanLi.Common.Event;\n\nnamespace AspNetCoreSample;\n\npublic class Program\n{\n pub"
},
{
"path": "samples/AspNetCoreSample/Startup.cs",
"chars": 1919,
"preview": "using AspNetCoreSample.Events;\nusing WeihanLi.Common;\nusing WeihanLi.Common.Event;\n\nnamespace AspNetCoreSample;\n\npublic"
},
{
"path": "samples/AspNetCoreSample/Views/Home/About.cshtml",
"chars": 154,
"preview": "@{\n ViewData[\"Title\"] = \"About\";\n}\n<h2>@ViewData[\"Title\"]</h2>\n<h3>@ViewData[\"Message\"]</h3>\n\n<p>Use this area to pr"
},
{
"path": "samples/AspNetCoreSample/Views/Home/Contact.cshtml",
"chars": 449,
"preview": "@{\n ViewData[\"Title\"] = \"Contact\";\n}\n<h2>@ViewData[\"Title\"]</h2>\n<h3>@ViewData[\"Message\"]</h3>\n\n<address>\n One Mi"
},
{
"path": "samples/AspNetCoreSample/Views/Home/Index.cshtml",
"chars": 5331,
"preview": "@{\n ViewData[\"Title\"] = \"Home Page\";\n}\n\n<div id=\"myCarousel\" class=\"carousel slide\" data-ride=\"carousel\" data-interv"
},
{
"path": "samples/AspNetCoreSample/Views/Shared/Error.cshtml",
"chars": 854,
"preview": "@model ErrorViewModel\n@{\n ViewData[\"Title\"] = \"Error\";\n}\n\n<h1 class=\"text-danger\">Error.</h1>\n<h2 class=\"text-danger"
},
{
"path": "samples/AspNetCoreSample/Views/Shared/_Layout.cshtml",
"chars": 3339,
"preview": "<!DOCTYPE html>\n<html>\n<head>\n <meta charset=\"utf-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initi"
},
{
"path": "samples/AspNetCoreSample/Views/Shared/_ValidationScriptsPartial.cshtml",
"chars": 1154,
"preview": "<environment include=\"Development\">\n <script src=\"~/lib/jquery-validation/dist/jquery.validate.js\"></script>\n <scr"
},
{
"path": "samples/AspNetCoreSample/Views/_ViewImports.cshtml",
"chars": 108,
"preview": "@using AspNetCoreSample\n@using AspNetCoreSample.Models\n@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers\n"
},
{
"path": "samples/AspNetCoreSample/Views/_ViewStart.cshtml",
"chars": 30,
"preview": "@{\n Layout = \"_Layout\";\n}\n"
},
{
"path": "samples/AspNetCoreSample/appsettings.json",
"chars": 215,
"preview": "{\n \"TestSetting\": {\n \"Setting1\": \"AAA\"\n },\n \"TestSetting2\": {\n \"Setting2\": \"$(TestSetting:Setting1)\"\n },\n \"L"
},
{
"path": "samples/AspNetCoreSample/bundleconfig.json",
"chars": 602,
"preview": "// Configure bundling and minification for the project.\n// More info at https://go.microsoft.com/fwlink/?LinkId=808241\n"
},
{
"path": "samples/AspNetCoreSample/wwwroot/css/site.css",
"chars": 650,
"preview": "body {\n padding-top: 50px;\n padding-bottom: 20px;\n}\n\n/* Wrapping element */\n/* Set some basic padding to keep con"
},
{
"path": "samples/AspNetCoreSample/wwwroot/js/site.js",
"chars": 32,
"preview": "// Write your JavaScript code.\n"
},
{
"path": "samples/AspNetCoreSample/wwwroot/lib/bootstrap/.bower.json",
"chars": 940,
"preview": "{\n \"name\": \"bootstrap\",\n \"description\": \"The most popular front-end framework for developing responsive, mobile first "
},
{
"path": "samples/AspNetCoreSample/wwwroot/lib/bootstrap/LICENSE",
"chars": 1085,
"preview": "The MIT License (MIT)\n\nCopyright (c) 2011-2016 Twitter, Inc.\n\nPermission is hereby granted, free of charge, to any perso"
},
{
"path": "samples/AspNetCoreSample/wwwroot/lib/bootstrap/dist/css/bootstrap-theme.css",
"chars": 26132,
"preview": "/*!\n * Bootstrap v3.3.7 (http://getbootstrap.com)\n * Copyright 2011-2016 Twitter, Inc.\n * Licensed under MIT (https://gi"
},
{
"path": "samples/AspNetCoreSample/wwwroot/lib/bootstrap/dist/css/bootstrap.css",
"chars": 146010,
"preview": "/*!\n * Bootstrap v3.3.7 (http://getbootstrap.com)\n * Copyright 2011-2016 Twitter, Inc.\n * Licensed under MIT (https://gi"
},
{
"path": "samples/AspNetCoreSample/wwwroot/lib/bootstrap/dist/js/bootstrap.js",
"chars": 69707,
"preview": "/*!\n * Bootstrap v3.3.7 (http://getbootstrap.com)\n * Copyright 2011-2016 Twitter, Inc.\n * Licensed under the MIT license"
},
{
"path": "samples/AspNetCoreSample/wwwroot/lib/bootstrap/dist/js/npm.js",
"chars": 484,
"preview": "// This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment.\nrequ"
},
{
"path": "samples/AspNetCoreSample/wwwroot/lib/jquery/.bower.json",
"chars": 523,
"preview": "{\n \"name\": \"jquery\",\n \"main\": \"dist/jquery.js\",\n \"license\": \"MIT\",\n \"ignore\": [\n \"package.json\"\n ],\n \"keywords\""
},
{
"path": "samples/AspNetCoreSample/wwwroot/lib/jquery/LICENSE.txt",
"chars": 1606,
"preview": "Copyright jQuery Foundation and other contributors, https://jquery.org/\n\nThis software consists of voluntary contributio"
},
{
"path": "samples/AspNetCoreSample/wwwroot/lib/jquery/dist/jquery.js",
"chars": 258388,
"preview": "/*!\n * jQuery JavaScript Library v2.2.0\n * http://jquery.com/\n *\n * Includes Sizzle.js\n * http://sizzlejs.com/\n *\n * Cop"
},
{
"path": "samples/AspNetCoreSample/wwwroot/lib/jquery-validation/.bower.json",
"chars": 885,
"preview": "{\n \"name\": \"jquery-validation\",\n \"homepage\": \"http://jqueryvalidation.org/\",\n \"repository\": {\n \"type\": \"git\",\n "
},
{
"path": "samples/AspNetCoreSample/wwwroot/lib/jquery-validation/LICENSE.md",
"chars": 1094,
"preview": "The MIT License (MIT)\n=====================\n\nCopyright Jörn Zaefferer\n\nPermission is hereby granted, free of charge, to "
},
{
"path": "samples/AspNetCoreSample/wwwroot/lib/jquery-validation/dist/additional-methods.js",
"chars": 36839,
"preview": "/*!\n * jQuery Validation Plugin v1.14.0\n *\n * http://jqueryvalidation.org/\n *\n * Copyright (c) 2015 Jörn Zaefferer\n * Re"
},
{
"path": "samples/AspNetCoreSample/wwwroot/lib/jquery-validation/dist/jquery.validate.js",
"chars": 42629,
"preview": "/*!\n * jQuery Validation Plugin v1.14.0\n *\n * http://jqueryvalidation.org/\n *\n * Copyright (c) 2015 Jörn Zaefferer\n * Re"
},
{
"path": "samples/AspNetCoreSample/wwwroot/lib/jquery-validation-unobtrusive/.bower.json",
"chars": 1100,
"preview": "{\n \"name\": \"jquery-validation-unobtrusive\",\n \"version\": \"3.2.6\",\n \"homepage\": \"https://github.com/aspnet/jquery-valid"
},
{
"path": "samples/AspNetCoreSample/wwwroot/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.js",
"chars": 18618,
"preview": "/*!\n** Unobtrusive validation support library for jQuery and jQuery Validate\n** Copyright (C) Microsoft Corporation. All"
},
{
"path": "samples/DotNetCoreSample/App.config",
"chars": 439,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<configuration>\n <connectionStrings>\n <add name=\"Test\" connectionString=\"se"
},
{
"path": "samples/DotNetCoreSample/AppHostTest.cs",
"chars": 4265,
"preview": "// Copyright (c) Weihan Li. All rights reserved.\n// Licensed under the Apache license.\n\nusing Microsoft.Extensions.Conf"
},
{
"path": "samples/DotNetCoreSample/AspectTest.cs",
"chars": 2135,
"preview": "using Microsoft.EntityFrameworkCore;\nusing WeihanLi.Common;\nusing WeihanLi.Common.Aspect;\nusing WeihanLi.Common.Depende"
},
{
"path": "samples/DotNetCoreSample/Base64UrlEncodeTest.cs",
"chars": 1037,
"preview": "using WeihanLi.Extensions;\n\nnamespace DotNetCoreSample;\n\npublic class Base64UrlEncodeTest\n{\n private const string Jw"
},
{
"path": "samples/DotNetCoreSample/CommandExecutorTest.cs",
"chars": 616,
"preview": "// Copyright (c) Weihan Li. All rights reserved.\n// Licensed under the MIT license.\n\nusing WeihanLi.Common.Helpers;\nusi"
},
{
"path": "samples/DotNetCoreSample/CronHelperTest.cs",
"chars": 902,
"preview": "using WeihanLi.Common.Helpers;\nusing WeihanLi.Extensions;\n\nnamespace DotNetCoreSample;\n\npublic static class CronHelperT"
},
{
"path": "samples/DotNetCoreSample/DataExtensionTest.cs",
"chars": 4614,
"preview": "using Microsoft.Data.SqlClient;\nusing Microsoft.Extensions.Configuration;\nusing System.ComponentModel.DataAnnotations.S"
},
{
"path": "samples/DotNetCoreSample/DependencyInjectionTest.cs",
"chars": 10019,
"preview": "using Microsoft.Extensions.Configuration;\nusing System.Diagnostics;\nusing WeihanLi.Common;\nusing WeihanLi.Common.Aspect"
},
{
"path": "samples/DotNetCoreSample/DisposeTest.cs",
"chars": 2581,
"preview": "// Copyright (c) Weihan Li. All rights reserved.\n// Licensed under the Apache license.\n\nusing WeihanLi.Common.Helpers;\n"
},
{
"path": "samples/DotNetCoreSample/DotNetCoreSample.csproj",
"chars": 1010,
"preview": "<Project Sdk=\"Microsoft.NET.Sdk\">\n\n <PropertyGroup>\n <OutputType>Exe</OutputType>\n <TargetFramework>$(LatestTarg"
},
{
"path": "samples/DotNetCoreSample/EventTest.cs",
"chars": 4064,
"preview": "using Microsoft.Extensions.DependencyInjection;\nusing System.Text.Json;\nusing WeihanLi.Common;\nusing WeihanLi.Common.Ev"
},
{
"path": "samples/DotNetCoreSample/GroupByEqualitySample.cs",
"chars": 2491,
"preview": "// Copyright (c) Weihan Li. All rights reserved.\n// Licensed under the Apache license.\n\nusing WeihanLi.Extensions;\n\nnam"
},
{
"path": "samples/DotNetCoreSample/HttpRequesterTest.cs",
"chars": 2667,
"preview": "using WeihanLi.Common.Http;\nusing WeihanLi.Extensions;\n\nnamespace DotNetCoreSample;\n\ninternal class HttpRequesterTest\n{"
},
{
"path": "samples/DotNetCoreSample/InMemoryStreamTest.cs",
"chars": 1621,
"preview": "// Copyright (c) Weihan Li. All rights reserved.\n// Licensed under the Apache license.\n\nusing WeihanLi.Common.Helpers;\n"
},
{
"path": "samples/DotNetCoreSample/LoggerTest.cs",
"chars": 2819,
"preview": "using Microsoft.Extensions.DependencyInjection;\nusing Microsoft.Extensions.Logging;\nusing WeihanLi.Common.Helpers;\nusin"
},
{
"path": "samples/DotNetCoreSample/MapperTest.cs",
"chars": 771,
"preview": "using WeihanLi.Common.Helpers;\n\nnamespace DotNetCoreSample;\n\ninternal class MapperTest\n{\n private class MapperA\n "
},
{
"path": "samples/DotNetCoreSample/NewtonJsonFormatter.cs",
"chars": 3693,
"preview": "// Copyright (c) Weihan Li. All rights reserved.\n// Licensed under the Apache license.\n\nusing Microsoft.Extensions.Depe"
},
{
"path": "samples/DotNetCoreSample/PagedListResultTest.cs",
"chars": 448,
"preview": "using WeihanLi.Common.Models;\n\nnamespace DotNetCoreSample;\n\npublic class PagedListResultTest\n{\n public static void M"
},
{
"path": "samples/DotNetCoreSample/PipelineTest.cs",
"chars": 9166,
"preview": "using WeihanLi.Common.Helpers;\n\n// ReSharper disable LocalizableElement\n\nnamespace DotNetCoreSample;\n\npublic class Pipe"
},
{
"path": "samples/DotNetCoreSample/ProcessExecutorTest.cs",
"chars": 1879,
"preview": "using System.Diagnostics;\nusing WeihanLi.Common.Helpers;\n\nnamespace DotNetCoreSample;\n\npublic class ProcessExecutorTest"
},
{
"path": "samples/DotNetCoreSample/Program.cs",
"chars": 11643,
"preview": "// Copyright (c) Weihan Li. All rights reserved.\n// Licensed under the Apache license.\n\nusing DotNetCoreSample;\nusing S"
},
{
"path": "samples/DotNetCoreSample/RepositoryTest.cs",
"chars": 2440,
"preview": "using Microsoft.Data.SqlClient;\nusing Microsoft.Extensions.Configuration;\nusing Microsoft.Extensions.ObjectPool;\nusing "
},
{
"path": "samples/DotNetCoreSample/RequestHelperTest.cs",
"chars": 1203,
"preview": "using System.Collections.Specialized;\nusing System.Diagnostics;\nusing WeihanLi.Common.Helpers;\nusing WeihanLi.Common.Lo"
},
{
"path": "samples/DotNetCoreSample/SerilogTest.cs",
"chars": 670,
"preview": "using Microsoft.Extensions.Logging;\nusing Serilog;\nusing WeihanLi.Common.Logging.Serilog;\n\nnamespace DotNetCoreSample;\n"
},
{
"path": "samples/DotNetCoreSample/ServiceDecoratorTest.cs",
"chars": 1190,
"preview": "// Copyright (c) Weihan Li. All rights reserved.\n// Licensed under the Apache license.\n\nusing Microsoft.Extensions.Depe"
},
{
"path": "samples/DotNetCoreSample/TaskTest.cs",
"chars": 943,
"preview": "using WeihanLi.Common.Helpers;\n\nnamespace DotNetCoreSample;\n\ninternal static class TaskTest\n{\n public static async T"
},
{
"path": "samples/DotNetCoreSample/TemplatingSample.cs",
"chars": 1944,
"preview": "// Copyright (c) Weihan Li. All rights reserved.\n// Licensed under the Apache license.\n\nusing Microsoft.Extensions.Conf"
},
{
"path": "samples/DotNetCoreSample/Test/PagedListModel1.cs",
"chars": 1206,
"preview": "using System.Collections;\n\nnamespace DotNetCoreSample.Test;\n\npublic class PagedListModel1<T> : IEnumerable<T>\n{\n pub"
},
{
"path": "samples/DotNetCoreSample/TotpTest.cs",
"chars": 533,
"preview": "// Copyright (c) Weihan Li. All rights reserved.\n// Licensed under the Apache license.\n\nusing WeihanLi.Common.Helpers;\n"
},
{
"path": "samples/DotNetCoreSample/appsettings.json",
"chars": 225,
"preview": "{\n \"ConnectionStrings\": {\n \"TestDb\": \"server=.;database=Test;uid=weihanli;pwd=Admin888\",\n \"Test\": \"server=.;datab"
},
{
"path": "src/Directory.Build.props",
"chars": 2257,
"preview": "<Project>\n <Import Project=\"$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))"
},
{
"path": "src/WeihanLi.Common/Abstractions/Properties.cs",
"chars": 308,
"preview": "// Copyright (c) Weihan Li. All rights reserved.\n// Licensed under the Apache license.\n\nnamespace WeihanLi.Common.Abstr"
},
{
"path": "src/WeihanLi.Common/Aspect/AspectDelegate.cs",
"chars": 5715,
"preview": "using WeihanLi.Common.Helpers;\nusing WeihanLi.Extensions;\n\nnamespace WeihanLi.Common.Aspect;\n\npublic static class Aspec"
},
{
"path": "src/WeihanLi.Common/Aspect/AspectInvokeException.cs",
"chars": 268,
"preview": "namespace WeihanLi.Common.Aspect;\n\npublic sealed class AspectInvokeException(IInvocation invocation, Exception innerExc"
},
{
"path": "src/WeihanLi.Common/Aspect/AttributeInterceptorResolver.cs",
"chars": 3572,
"preview": "using System.Diagnostics.CodeAnalysis;\nusing System.Reflection;\nusing WeihanLi.Extensions;\n\nnamespace WeihanLi.Common.A"
},
{
"path": "src/WeihanLi.Common/Aspect/DefaultProxyFactory.cs",
"chars": 2403,
"preview": "using System.Diagnostics.CodeAnalysis;\nusing WeihanLi.Common.Helpers;\n\nnamespace WeihanLi.Common.Aspect;\n\npublic sealed"
},
{
"path": "src/WeihanLi.Common/Aspect/DefaultProxyTypeFactory.cs",
"chars": 1101,
"preview": "namespace WeihanLi.Common.Aspect;\n\npublic sealed class DefaultProxyTypeFactory : IProxyTypeFactory\n{\n public static "
},
{
"path": "src/WeihanLi.Common/Aspect/DelegateInterceptor.cs",
"chars": 547,
"preview": "namespace WeihanLi.Common.Aspect;\n\n[CLSCompliant(false)]\npublic sealed class DelegateInterceptor(Func<IInvocation, Func"
},
{
"path": "src/WeihanLi.Common/Aspect/FluentAspectOptions.cs",
"chars": 697,
"preview": "namespace WeihanLi.Common.Aspect;\n\npublic sealed class FluentAspectOptions\n{\n public readonly Dictionary<Func<IInvoc"
},
{
"path": "src/WeihanLi.Common/Aspect/FluentAspectOptionsExtensions.cs",
"chars": 12836,
"preview": "using System.Diagnostics.CodeAnalysis;\nusing System.Linq.Expressions;\nusing System.Reflection;\nusing WeihanLi.Common.He"
},
{
"path": "src/WeihanLi.Common/Aspect/FluentAspects.cs",
"chars": 822,
"preview": "namespace WeihanLi.Common.Aspect;\n\npublic static class FluentAspects\n{\n public static readonly FluentAspectOptions A"
},
{
"path": "src/WeihanLi.Common/Aspect/FluentAspectsBuilder.cs",
"chars": 348,
"preview": "using Microsoft.Extensions.DependencyInjection;\n\nnamespace WeihanLi.Common.Aspect;\n\npublic interface IFluentAspectsBuil"
},
{
"path": "src/WeihanLi.Common/Aspect/FluentAspectsServiceContainerBuilder.cs",
"chars": 409,
"preview": "using WeihanLi.Common.DependencyInjection;\n\nnamespace WeihanLi.Common.Aspect;\n\npublic interface IFluentAspectsServiceCo"
},
{
"path": "src/WeihanLi.Common/Aspect/FluentConfigInterceptorResolver.cs",
"chars": 1201,
"preview": "namespace WeihanLi.Common.Aspect;\n\npublic sealed class FluentConfigInterceptorResolver : IInterceptorResolver\n{\n pub"
},
{
"path": "src/WeihanLi.Common/Aspect/IInterceptionConfiguration.cs",
"chars": 2038,
"preview": "using System.Diagnostics.CodeAnalysis;\nusing WeihanLi.Common.Helpers;\n\nnamespace WeihanLi.Common.Aspect;\n\npublic interf"
},
{
"path": "src/WeihanLi.Common/Aspect/IInterceptor.cs",
"chars": 985,
"preview": "namespace WeihanLi.Common.Aspect;\n\npublic interface IInterceptor\n{\n Task Invoke(IInvocation invocation, Func<Task> n"
},
{
"path": "src/WeihanLi.Common/Aspect/IInterceptorResolver.cs",
"chars": 219,
"preview": "namespace WeihanLi.Common.Aspect;\n\npublic interface IInterceptorResolver\n{\n [RequiresUnreferencedCode(\"Unreferenced "
},
{
"path": "src/WeihanLi.Common/Aspect/IInvocation.cs",
"chars": 1812,
"preview": "using System.Diagnostics.CodeAnalysis;\nusing System.Reflection;\n\nnamespace WeihanLi.Common.Aspect;\n\npublic interface II"
},
{
"path": "src/WeihanLi.Common/Aspect/IProxyFactory.cs",
"chars": 789,
"preview": "using System.Diagnostics.CodeAnalysis;\n\nnamespace WeihanLi.Common.Aspect;\n\npublic interface IProxyFactory\n{\n [Requir"
},
{
"path": "src/WeihanLi.Common/Aspect/IProxyTypeFactory.cs",
"chars": 472,
"preview": "namespace WeihanLi.Common.Aspect;\n\npublic interface IProxyTypeFactory\n{\n [RequiresDynamicCode(\"Defining a dynamic as"
},
{
"path": "src/WeihanLi.Common/Aspect/InternalAspectHelper.cs",
"chars": 1360,
"preview": "using System.Reflection;\n\nnamespace WeihanLi.Common.Aspect;\n\ninternal static class MethodInvokeHelper\n{\n public stat"
},
{
"path": "src/WeihanLi.Common/Aspect/InvocationEnricher.cs",
"chars": 1109,
"preview": "using WeihanLi.Common.Helpers;\n\nnamespace WeihanLi.Common.Aspect;\n\npublic interface IInvocationEnricher : IEnricher<IIn"
},
{
"path": "src/WeihanLi.Common/Aspect/InvocationEnricherExtensions.cs",
"chars": 910,
"preview": "namespace WeihanLi.Common.Aspect;\n\npublic static class InvocationEnricherExtensions\n{\n public static void AddPropert"
},
{
"path": "src/WeihanLi.Common/Aspect/MethodSignature.cs",
"chars": 1488,
"preview": "using System.Reflection;\n\nnamespace WeihanLi.Common.Aspect;\n\ninternal sealed class MethodSignature(string methodName, I"
},
{
"path": "src/WeihanLi.Common/Aspect/ProxyFactoryExtensions.cs",
"chars": 6424,
"preview": "using System.Diagnostics.CodeAnalysis;\n\nnamespace WeihanLi.Common.Aspect;\n\npublic static class ProxyFactoryExtensions\n{"
},
{
"path": "src/WeihanLi.Common/Aspect/ProxyUtils.cs",
"chars": 37295,
"preview": "using System.Diagnostics.CodeAnalysis;\nusing System.Reflection;\nusing System.Reflection.Emit;\nusing WeihanLi.Extensions"
},
{
"path": "src/WeihanLi.Common/Aspect/ServiceCollectionExtensions.cs",
"chars": 9894,
"preview": "using Microsoft.Extensions.DependencyInjection;\nusing Microsoft.Extensions.DependencyInjection.Extensions;\nusing System"
},
{
"path": "src/WeihanLi.Common/Aspect/ServiceContainerBuilderExtensions.cs",
"chars": 10354,
"preview": "using System.Linq.Expressions;\nusing WeihanLi.Common.DependencyInjection;\nusing WeihanLi.Extensions;\nusing ServiceLifet"
},
{
"path": "src/WeihanLi.Common/CacheUtil.cs",
"chars": 1950,
"preview": "using System.Collections.Concurrent;\nusing System.Diagnostics.CodeAnalysis;\nusing System.Reflection;\nusing WeihanLi.Com"
},
{
"path": "src/WeihanLi.Common/Compressor/DataCompressor.cs",
"chars": 2139,
"preview": "using WeihanLi.Extensions;\n\nnamespace WeihanLi.Common.Compressor;\n\n/// <summary>\n/// DataCompressor\n/// </summary>\npubl"
},
{
"path": "src/WeihanLi.Common/Data/Expressions/DateTimeExpressionParser.cs",
"chars": 738,
"preview": "using System.Linq.Expressions;\n\n// ReSharper disable once CheckNamespace\nnamespace WeihanLi.Common.Data;\n\n/// <summary>"
},
{
"path": "src/WeihanLi.Common/Data/Expressions/StringExpressionParser.cs",
"chars": 3165,
"preview": "using System.Linq.Expressions;\n\n// ReSharper disable once CheckNamespace\nnamespace WeihanLi.Common.Data;\n\n/// <summary>"
},
{
"path": "src/WeihanLi.Common/Data/IRepository.cs",
"chars": 11664,
"preview": "using System.Linq.Expressions;\nusing WeihanLi.Common.Models;\n\nnamespace WeihanLi.Common.Data;\n\npublic interface IReadOn"
},
{
"path": "src/WeihanLi.Common/Data/IUnitOfWork.cs",
"chars": 250,
"preview": "namespace WeihanLi.Common.Data;\n\npublic interface IUnitOfWork\n{\n void Commit();\n\n Task CommitAsync(CancellationTo"
},
{
"path": "src/WeihanLi.Common/Data/Repository.cs",
"chars": 34176,
"preview": "using System.ComponentModel.DataAnnotations;\nusing System.ComponentModel.DataAnnotations.Schema;\nusing System.Data.Comm"
},
{
"path": "src/WeihanLi.Common/Data/RepositoryExtension.cs",
"chars": 4425,
"preview": "using System.Linq.Expressions;\n\nnamespace WeihanLi.Common.Data;\n\npublic static class RepositoryExtension\n{\n public s"
},
{
"path": "src/WeihanLi.Common/Data/SqlExpressionParser.cs",
"chars": 4921,
"preview": "using System.Linq.Expressions;\nusing WeihanLi.Extensions;\n\nnamespace WeihanLi.Common.Data;\n\ninternal static partial cla"
},
{
"path": "src/WeihanLi.Common/Data/SqlExpressionVisitor.cs",
"chars": 4316,
"preview": "using System.Linq.Expressions;\nusing WeihanLi.Extensions;\n\nnamespace WeihanLi.Common.Data;\n\npublic class SqlExpressionV"
},
{
"path": "src/WeihanLi.Common/Data/UnitOfWork.cs",
"chars": 1366,
"preview": "using System.Data;\nusing WeihanLi.Extensions;\n\nnamespace WeihanLi.Common.Data;\n\n[CLSCompliant(false)]\npublic class Unit"
},
{
"path": "src/WeihanLi.Common/DependencyInjection/DependencyInjectionExtensions.cs",
"chars": 2143,
"preview": "using System.Diagnostics.CodeAnalysis;\n\n// ReSharper disable once CheckNamespace\nnamespace WeihanLi.Common;\n\npublic sta"
},
{
"path": "src/WeihanLi.Common/DependencyInjection/FromServiceAttribute.cs",
"chars": 243,
"preview": "namespace WeihanLi.Common.DependencyInjection;\n\n[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | At"
},
{
"path": "src/WeihanLi.Common/DependencyInjection/ServiceConstructorAttribute.cs",
"chars": 199,
"preview": "namespace WeihanLi.Common.DependencyInjection;\n\n[AttributeUsage(AttributeTargets.Constructor, AllowMultiple = false, In"
},
{
"path": "src/WeihanLi.Common/DependencyInjection/ServiceContainer.cs",
"chars": 15350,
"preview": "using System.Collections.Concurrent;\nusing System.Diagnostics.CodeAnalysis;\nusing System.Linq.Expressions;\nusing System"
},
{
"path": "src/WeihanLi.Common/DependencyInjection/ServiceContainerBuilder.cs",
"chars": 1205,
"preview": "using System.Collections;\n\nnamespace WeihanLi.Common.DependencyInjection;\n\npublic interface IServiceContainerBuilder : "
},
{
"path": "src/WeihanLi.Common/DependencyInjection/ServiceContainerBuilderExtensions.cs",
"chars": 10977,
"preview": "using System.Diagnostics.CodeAnalysis;\nusing System.Reflection;\nusing WeihanLi.Common.Helpers;\nusing WeihanLi.Extension"
},
{
"path": "src/WeihanLi.Common/DependencyInjection/ServiceContainerBuilderExtensions.generated.cs",
"chars": 9434,
"preview": "\nnamespace WeihanLi.Common.DependencyInjection;\n\npublic static partial class ServiceContainerBuilderExtensions\n{\n pu"
},
{
"path": "src/WeihanLi.Common/DependencyInjection/ServiceContainerBuilderExtensions.tt",
"chars": 2742,
"preview": "<#@ template debug=\"false\" hostspecific=\"false\" language=\"C#\" #>\n<#@ assembly name=\"System.Core\" #>\n<#@ import namespac"
},
{
"path": "src/WeihanLi.Common/DependencyInjection/ServiceContainerModule.cs",
"chars": 342,
"preview": "namespace WeihanLi.Common.DependencyInjection;\n\npublic interface IServiceContainerModule\n{\n void ConfigureServices(I"
},
{
"path": "src/WeihanLi.Common/DependencyInjection/ServiceDefinition.cs",
"chars": 3729,
"preview": "using System.Diagnostics.CodeAnalysis;\n\nnamespace WeihanLi.Common.DependencyInjection;\n\npublic class ServiceDefinition\n"
},
{
"path": "src/WeihanLi.Common/DependencyInjection/ServiceLifetime.cs",
"chars": 503,
"preview": "namespace WeihanLi.Common.DependencyInjection;\n\npublic enum ServiceLifetime\n{\n /// <summary>\n /// Specifies that "
},
{
"path": "src/WeihanLi.Common/DependencyResolver.cs",
"chars": 8004,
"preview": "// Copyright (c) Weihan Li. All rights reserved.\n// Licensed under the Apache license.\n\nusing Microsoft.Extensions.Depe"
},
{
"path": "src/WeihanLi.Common/Event/AckQueue.cs",
"chars": 3142,
"preview": "using System.Collections.Concurrent;\nusing System.Runtime.CompilerServices;\nusing WeihanLi.Common.Helpers;\n\nnamespace W"
},
{
"path": "src/WeihanLi.Common/Event/DelegateEventHandler.cs",
"chars": 1144,
"preview": "// Copyright (c) Weihan Li. All rights reserved.\n// Licensed under the Apache license.\n\nusing WeihanLi.Extensions;\n\nnam"
},
{
"path": "src/WeihanLi.Common/Event/EventBase.cs",
"chars": 3145,
"preview": "// Copyright (c) Weihan Li. All rights reserved.\n// Licensed under the Apache license.\n\nusing Newtonsoft.Json;\nusing We"
},
{
"path": "src/WeihanLi.Common/Event/EventBus.cs",
"chars": 2409,
"preview": "// Copyright (c) Weihan Li. All rights reserved.\n// Licensed under the Apache license.\n\nusing System.Diagnostics;\nusing"
},
{
"path": "src/WeihanLi.Common/Event/EventBusExtensions.cs",
"chars": 3776,
"preview": "// Copyright (c) Weihan Li. All rights reserved.\n// Licensed under the Apache license.\n\nusing Microsoft.Extensions.Depe"
},
{
"path": "src/WeihanLi.Common/Event/EventHandler.cs",
"chars": 1419,
"preview": "// Copyright (c) Weihan Li. All rights reserved.\n// Licensed under the Apache license.\n\nusing Newtonsoft.Json.Linq;\nusi"
},
{
"path": "src/WeihanLi.Common/Event/EventHandlerFactory.cs",
"chars": 533,
"preview": "// Copyright (c) Weihan Li. All rights reserved.\n// Licensed under the Apache license.\n\nusing System.Diagnostics.CodeAn"
},
{
"path": "src/WeihanLi.Common/Event/EventProperties.cs",
"chars": 493,
"preview": "// Copyright (c) Weihan Li. All rights reserved.\n// Licensed under the Apache license.\n\nnamespace WeihanLi.Common.Event"
},
{
"path": "src/WeihanLi.Common/Event/EventQueueInMemory.cs",
"chars": 2956,
"preview": "// Copyright (c) Weihan Li. All rights reserved.\n// Licensed under the Apache license.\n\nusing System.Collections.Concur"
},
{
"path": "src/WeihanLi.Common/Event/EventQueuePublisher.cs",
"chars": 1605,
"preview": "// Copyright (c) Weihan Li. All rights reserved.\n// Licensed under the Apache license.\n\nusing Microsoft.Extensions.Opti"
},
{
"path": "src/WeihanLi.Common/Event/EventStoreInMemory.cs",
"chars": 875,
"preview": "// Copyright (c) Weihan Li. All rights reserved.\n// Licensed under the Apache license.\n\nusing System.Collections.Concur"
},
{
"path": "src/WeihanLi.Common/Event/EventSubscriptionManager.cs",
"chars": 3141,
"preview": "// Copyright (c) Weihan Li. All rights reserved.\n// Licensed under the Apache license.\n\nusing System.Collections.Concur"
},
{
"path": "src/WeihanLi.Common/Event/IEventBus.cs",
"chars": 187,
"preview": "// Copyright (c) Weihan Li. All rights reserved.\n// Licensed under the Apache license.\n\nnamespace WeihanLi.Common.Event"
},
{
"path": "src/WeihanLi.Common/Event/IEventHandlerFactory.cs",
"chars": 542,
"preview": "// Copyright (c) Weihan Li. All rights reserved.\n// Licensed under the Apache license.\n\nnamespace WeihanLi.Common.Event"
},
{
"path": "src/WeihanLi.Common/Event/IEventPublisher.cs",
"chars": 528,
"preview": "// Copyright (c) Weihan Li. All rights reserved.\n// Licensed under the Apache license.\n\nnamespace WeihanLi.Common.Event"
},
{
"path": "src/WeihanLi.Common/Event/IEventQueue.cs",
"chars": 1327,
"preview": "// Copyright (c) Weihan Li. All rights reserved.\n// Licensed under the Apache license.\n\nusing System.Runtime.CompilerSe"
},
{
"path": "src/WeihanLi.Common/Event/IEventStore.cs",
"chars": 278,
"preview": "// Copyright (c) Weihan Li. All rights reserved.\n// Licensed under the Apache license.\n\nnamespace WeihanLi.Common.Event"
},
{
"path": "src/WeihanLi.Common/Event/IEventSubscriber.cs",
"chars": 2159,
"preview": "// Copyright (c) Weihan Li. All rights reserved.\n// Licensed under the Apache license.\n\nnamespace WeihanLi.Common.Event"
},
{
"path": "src/WeihanLi.Common/Extensions/CollectionExtension.cs",
"chars": 9793,
"preview": "using System.Collections.Specialized;\nusing System.Diagnostics.CodeAnalysis;\nusing System.Text;\nusing WeihanLi.Common;\n"
},
{
"path": "src/WeihanLi.Common/Extensions/CompressionExtension.cs",
"chars": 21374,
"preview": "using System.IO.Compression;\nusing System.Text;\n\n// ReSharper disable once CheckNamespace\nnamespace WeihanLi.Extensions"
},
{
"path": "src/WeihanLi.Common/Extensions/ConfigurationExtension.cs",
"chars": 8633,
"preview": "using System.Diagnostics.CodeAnalysis;\nusing System.Text.RegularExpressions;\nusing WeihanLi.Common;\nusing WeihanLi.Exte"
},
{
"path": "src/WeihanLi.Common/Extensions/CoreExtension.cs",
"chars": 75000,
"preview": "// Copyright (c) Weihan Li. All rights reserved.\n// Licensed under the Apache license.\n\nusing System.Collections.Concur"
}
]
// ... and 245 more files (download for full content)
About this extraction
This page contains the full source code of the WeihanLi/WeihanLi.Common GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 445 files (2.1 MB), approximately 584.7k tokens, and a symbol index with 3182 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.