mirror of
https://github.com/dotnetcore/Util.git
synced 2026-10-27 02:13:39 +08:00
1. Oracle EntityFrameworkCore 配置增加 **isGuidToString** 选项, 用于存储时是否将Guid类型转换为字符串类型. 2. Http操作类增加 **HttpCompletion** 方法, 用于设置响应完成模式. Bug修复 1. 表格列组件\<**util-column**> 设置 **left** 属性为 **true** 时生成 nzLeft = "true" ,修复为 [nzLeft]="true"
47 lines
1.4 KiB
C#
47 lines
1.4 KiB
C#
using Microsoft.AspNetCore.Builder;
|
|
using Microsoft.AspNetCore.Hosting;
|
|
using Microsoft.AspNetCore.TestHost;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using Microsoft.Extensions.Hosting;
|
|
using Util.Http;
|
|
using Xunit.DependencyInjection.Logging;
|
|
|
|
namespace Util.AspNetCore.Tests;
|
|
|
|
/// <summary>
|
|
/// 启动配置
|
|
/// </summary>
|
|
public class Startup {
|
|
/// <summary>
|
|
/// 配置主机
|
|
/// </summary>
|
|
public void ConfigureHost( IHostBuilder hostBuilder ) {
|
|
hostBuilder.ConfigureWebHostDefaults( webHostBuilder => {
|
|
webHostBuilder.UseTestServer()
|
|
.Configure( t => {
|
|
t.UseRouting();
|
|
t.UseAuthentication();
|
|
t.UseAuthorization();
|
|
t.UseEndpoints( endpoints => {
|
|
endpoints.MapControllers();
|
|
} );
|
|
} );
|
|
} )
|
|
.AsBuild()
|
|
.AddAcl()
|
|
.AddUtil();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 配置服务
|
|
/// </summary>
|
|
public void ConfigureServices( IServiceCollection services ) {
|
|
services.AddLogging( logBuilder => logBuilder.AddXunitOutput() );
|
|
services.AddControllers();
|
|
services.AddTransient<IHttpClient>( t => {
|
|
var client = new HttpClientService();
|
|
client.SetHttpClient( t.GetService<IHost>().GetTestClient() );
|
|
return client;
|
|
} );
|
|
}
|
|
} |