Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5f9312bdce | |||
| 2cbbe4272a | |||
| b8984dc560 | |||
| 323d449772 |
@ -1,8 +1,23 @@
|
||||
using System.Reflection;
|
||||
using System.IO;
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
// Add services to the container.
|
||||
builder.Services.AddControllers();
|
||||
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
|
||||
|
||||
var controllers = builder.Services.AddControllers();
|
||||
Console.WriteLine(Environment.CurrentDirectory);
|
||||
Console.WriteLine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location));
|
||||
var files = Directory.GetFiles($"{Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)}/plugins");
|
||||
Console.WriteLine(files.Length);
|
||||
foreach (var file in files)
|
||||
{
|
||||
Console.WriteLine(file);
|
||||
var assembly = Assembly.LoadFrom(file);
|
||||
controllers = controllers.AddApplicationPart(assembly);
|
||||
}
|
||||
|
||||
// var assembly = Assembly.LoadFrom("pluginA.dll");
|
||||
// // Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
|
||||
builder.Services.AddEndpointsApiExplorer();
|
||||
builder.Services.AddSwaggerGen();
|
||||
|
||||
|
||||
@ -2,6 +2,10 @@ namespace api;
|
||||
|
||||
public class WeatherForecast
|
||||
{
|
||||
public string Name { get; set; }
|
||||
|
||||
public string Description { get; set; }
|
||||
|
||||
public DateOnly Date { get; set; }
|
||||
|
||||
public int TemperatureC { get; set; }
|
||||
@ -9,4 +13,6 @@ public class WeatherForecast
|
||||
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
|
||||
|
||||
public string? Summary { get; set; }
|
||||
|
||||
public double AnotherThing { get; set; }
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user