添加:选项模式(下)学习项目
parent
5728e2295a
commit
dfa148ef4a
@ -0,0 +1,16 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration" Version="6.0.1" />
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.1" />
|
||||
<PackageReference Include="Microsoft.Extensions.Options" Version="6.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
@ -0,0 +1,8 @@
|
||||
{
|
||||
"AppName": "customAppNmae",
|
||||
"AppVersion": "0.0.0.1",
|
||||
"EMail": {
|
||||
"ReceiveAddress": "custom@163.com",
|
||||
"Recipient": "custom"
|
||||
}
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
{
|
||||
"AppName": "developmentAppNmae",
|
||||
"AppVersion": "0.0.0.1",
|
||||
"EMail": {
|
||||
"ReceiveAddress": "development@163.com",
|
||||
"Recipient": "development"
|
||||
}
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
# App设置
|
||||
AppName=IniAppName
|
||||
AppVersion=0.0.0.1
|
||||
|
||||
[Email]
|
||||
#邮箱设置
|
||||
ReceiveAddress=ini@163.com
|
||||
Recipient=ini
|
@ -0,0 +1,8 @@
|
||||
{
|
||||
"AppName": "JsonAppNmae",
|
||||
"AppVersion": "0.0.0.1",
|
||||
"EMail": {
|
||||
"ReceiveAddress": "json@163.com",
|
||||
"Recipient": "json"
|
||||
}
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
{
|
||||
"AppName": "productAppNmae",
|
||||
"AppVersion": "0.0.0.1",
|
||||
"EMail": {
|
||||
"ReceiveAddress": "product@163.com",
|
||||
"Recipient": "product"
|
||||
}
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
#yaml配置格式
|
||||
AppName: YamlAppName
|
||||
AppVersion: 0.0.0.1
|
||||
|
||||
#邮件配置
|
||||
EMail:
|
||||
ReceiveAddress: yaml@163.com
|
||||
Recipient: yaml
|
@ -0,0 +1,64 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
|
||||
<IsPackable>false</IsPackable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="AutoFixture" Version="4.17.0" />
|
||||
<PackageReference Include="AutoFixture.AutoMoq" Version="4.17.0" />
|
||||
<PackageReference Include="AutoFixture.Xunit2" Version="4.17.0" />
|
||||
<PackageReference Include="FluentAssertions" Version="6.8.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration" Version="7.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="7.0.1" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.CommandLine" Version="7.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="7.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Ini" Version="7.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="7.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Xml" Version="7.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Options" Version="7.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="7.0.0" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.1" />
|
||||
<PackageReference Include="Moq" Version="4.18.3" />
|
||||
<PackageReference Include="xunit" Version="2.4.2" />
|
||||
<PackageReference Include="Xunit.DependencyInjection" Version="8.6.1" />
|
||||
<PackageReference Include="Xunit.DependencyInjection.Logging" Version="8.0.1" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="coverlet.collector" Version="3.2.0">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Update="Configs\appsettings.custom.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Configs\appsettings.development.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Configs\appsettings.ini">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Configs\appsettings.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Configs\appsettings.product.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Configs\appsettings.xml">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Configs\appsettings.yml">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
@ -0,0 +1,35 @@
|
||||
global using System;
|
||||
global using System.Linq;
|
||||
global using System.Text;
|
||||
global using System.Threading.Tasks;
|
||||
global using System.Collections;
|
||||
global using System.Collections.Generic;
|
||||
global using System.Collections.Concurrent;
|
||||
global using System.Collections.Specialized;
|
||||
|
||||
global using Microsoft.Extensions.Configuration;
|
||||
global using Microsoft.Extensions.Configuration.Memory;
|
||||
global using Microsoft.Extensions.Configuration.EnvironmentVariables;
|
||||
global using Microsoft.Extensions.Configuration.CommandLine;
|
||||
global using Microsoft.Extensions.Configuration.UserSecrets;
|
||||
global using Microsoft.Extensions.Configuration.Json;
|
||||
global using Microsoft.Extensions.Configuration.Ini;
|
||||
global using Microsoft.Extensions.Configuration.Xml;
|
||||
|
||||
|
||||
global using Xunit;
|
||||
global using Xunit.Abstractions;
|
||||
global using Xunit.DependencyInjection;
|
||||
|
||||
global using Moq;
|
||||
global using Moq.Internals;
|
||||
global using Moq.Language;
|
||||
global using Moq.Protected;
|
||||
|
||||
global using AutoFixture;
|
||||
global using AutoFixture.DataAnnotations;
|
||||
global using AutoFixture.AutoMoq;
|
||||
global using AutoFixture.Xunit2;
|
||||
|
||||
global using FluentAssertions;
|
||||
global using FluentAssertions.Extensions;
|
@ -0,0 +1,8 @@
|
||||
{
|
||||
"AppName": "customAppNmae",
|
||||
"AppVersion": "0.0.0.1",
|
||||
"EMail": {
|
||||
"ReceiveAddress": "custom@163.com",
|
||||
"Recipient": "custom"
|
||||
}
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
{
|
||||
"AppName": "developmentAppNmae",
|
||||
"AppVersion": "0.0.0.1",
|
||||
"EMail": {
|
||||
"ReceiveAddress": "development@163.com",
|
||||
"Recipient": "development"
|
||||
}
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
# App设置
|
||||
AppName=IniAppName
|
||||
AppVersion=0.0.0.1
|
||||
|
||||
[Email]
|
||||
#邮箱设置
|
||||
ReceiveAddress=ini@163.com
|
||||
Recipient=ini
|
@ -0,0 +1,8 @@
|
||||
{
|
||||
"AppName": "JsonAppNmae",
|
||||
"AppVersion": "0.0.0.1",
|
||||
"EMail": {
|
||||
"ReceiveAddress": "json@163.com",
|
||||
"Recipient": "json"
|
||||
}
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
{
|
||||
"AppName": "productAppNmae",
|
||||
"AppVersion": "0.0.0.1",
|
||||
"EMail": {
|
||||
"ReceiveAddress": "product@163.com",
|
||||
"Recipient": "product"
|
||||
}
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
#yaml配置格式
|
||||
AppName: YamlAppName
|
||||
AppVersion: 0.0.0.1
|
||||
|
||||
#邮件配置
|
||||
EMail:
|
||||
ReceiveAddress: yaml@163.com
|
||||
Recipient: yaml
|
@ -0,0 +1,35 @@
|
||||
global using System;
|
||||
global using System.Linq;
|
||||
global using System.Text;
|
||||
global using System.Threading.Tasks;
|
||||
global using System.Collections;
|
||||
global using System.Collections.Generic;
|
||||
global using System.Collections.Concurrent;
|
||||
global using System.Collections.Specialized;
|
||||
|
||||
global using Microsoft.Extensions.Configuration;
|
||||
global using Microsoft.Extensions.Configuration.Memory;
|
||||
global using Microsoft.Extensions.Configuration.EnvironmentVariables;
|
||||
global using Microsoft.Extensions.Configuration.CommandLine;
|
||||
global using Microsoft.Extensions.Configuration.UserSecrets;
|
||||
global using Microsoft.Extensions.Configuration.Json;
|
||||
global using Microsoft.Extensions.Configuration.Ini;
|
||||
global using Microsoft.Extensions.Configuration.Xml;
|
||||
|
||||
|
||||
global using Xunit;
|
||||
global using Xunit.Abstractions;
|
||||
global using Xunit.DependencyInjection;
|
||||
|
||||
global using Moq;
|
||||
global using Moq.Internals;
|
||||
global using Moq.Language;
|
||||
global using Moq.Protected;
|
||||
|
||||
global using AutoFixture;
|
||||
global using AutoFixture.DataAnnotations;
|
||||
global using AutoFixture.AutoMoq;
|
||||
global using AutoFixture.Xunit2;
|
||||
|
||||
global using FluentAssertions;
|
||||
global using FluentAssertions.Extensions;
|
Loading…
Reference in New Issue