mirror of
https://github.com/BeyondDimension/SteamTools.git
synced 2026-10-28 23:19:53 +08:00
update readme.md migrate V2 1%
This commit is contained in:
@@ -133,6 +133,7 @@ namespace System.Application
|
||||
/// <param name="options"></param>
|
||||
public virtual void ConfigureMainProcessServices(IServiceCollection services, TAppSettings options)
|
||||
{
|
||||
services.TryAddModelValidator();
|
||||
services.TryAddPermissions();
|
||||
services.TryAddToast();
|
||||
services.AddPlatformPermissions();
|
||||
|
||||
@@ -5,26 +5,12 @@ using System.Application.Services.Implementation;
|
||||
using System.Application.Services.Implementation.Permissions;
|
||||
using System.Diagnostics;
|
||||
using System.Logging;
|
||||
using MSEXOptions = Microsoft.Extensions.Options.Options;
|
||||
|
||||
// ReSharper disable once CheckNamespace
|
||||
namespace Microsoft.Extensions.DependencyInjection
|
||||
{
|
||||
public static class ServiceCollectionExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// 尝试添加配置项
|
||||
/// </summary>
|
||||
/// <typeparam name="TOptions"></typeparam>
|
||||
/// <param name="services"></param>
|
||||
/// <param name="options"></param>
|
||||
/// <returns></returns>
|
||||
public static IServiceCollection TryAddOptions<TOptions>(this IServiceCollection services, TOptions options) where TOptions : class, new()
|
||||
{
|
||||
services.TryAddSingleton(MSEXOptions.Create(options));
|
||||
return services;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 尝试添加适用于安卓平台的Toast
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user