diff --git a/csharp/main.cs b/csharp/main.cs new file mode 100644 index 0000000..a5f9514 --- /dev/null +++ b/csharp/main.cs @@ -0,0 +1,60 @@ +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; + +namespace ORB +{ + public class Program + { + public static void Main(string[] args) + { + CreateHostBuilder(args).Build().Run(); + } + + public static IHostBuilder CreateHostBuilder(string[] args) => + Host.CreateDefaultBuilder(args) + .ConfigureWebHostDefaults(webBuilder => + { + webBuilder.UseStartup(); + }); + } + + public class Startup + { + public void ConfigureServices(IServiceCollection services) + { + services.AddCors(options => + { + options.AddDefaultPolicy(builder => + { + builder.AllowAnyOrigin() + .AllowAnyMethod() + .AllowAnyHeader(); + }); + }); + services.AddControllers(); + services.AddRazorPages(); + } + + public void Configure(IApplicationBuilder app, IWebHostEnvironment env) + { + if (env.IsDevelopment()) + { + app.UseDeveloperExceptionPage(); + } + + app.UseRouting(); + + app.UseCors(); + + app.UseAuthorization(); + + app.UseEndpoints(endpoints => + { + endpoints.MapControllers(); + endpoints.MapRazorPages(); + }); + } + } +} \ No newline at end of file diff --git a/csharp/main.csproj b/csharp/main.csproj new file mode 100644 index 0000000..415dab4 --- /dev/null +++ b/csharp/main.csproj @@ -0,0 +1,14 @@ + + + + Exe + netcoreapp7.0 + ORB.Program + enable + + + + + + + \ No newline at end of file diff --git a/csharp/packages.lock.json b/csharp/packages.lock.json new file mode 100644 index 0000000..2712a54 --- /dev/null +++ b/csharp/packages.lock.json @@ -0,0 +1,6 @@ +{ + "version": 1, + "dependencies": { + "net7.0": {} + } +} \ No newline at end of file