You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
1.2 KiB
C#
43 lines
1.2 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Runtime.CompilerServices;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
using Microsoft.Extensions.Configuration;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using Microsoft.Extensions.Hosting;
|
|
|
|
namespace OllamaStudy.Core
|
|
{
|
|
public static class OllamaServerExtenstons
|
|
{
|
|
public static IServiceCollection AddServerConfig(this IServiceCollection services, IConfiguration configuration)
|
|
{
|
|
services.AddOptions();
|
|
services.Configure<OllamaServerOption>(configuration.GetSection("OllamaServer"));
|
|
|
|
|
|
//services.AddOptions();
|
|
|
|
//services
|
|
// .AddOptions<OllamaServerOption>()
|
|
// .Configure(config => { });
|
|
|
|
//services
|
|
// .AddOptions<OllamaServerOption>()
|
|
// .Configure<OllamaServerOption>((a, b) => { });
|
|
|
|
//services.Configure<OllamaServerOption>(configuration.GetSection("OllamaServer"));
|
|
|
|
return services;
|
|
}
|
|
|
|
public static IHost UseServerConfig(this IHost app)
|
|
{
|
|
return app;
|
|
}
|
|
}
|
|
}
|