Skip to content

Commit ee356cd

Browse files
committed
Removed Startup.cs
1 parent 3e3cb40 commit ee356cd

File tree

2 files changed

+25
-76
lines changed

2 files changed

+25
-76
lines changed
Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// ------------------------------------------------------------------------
1+
// ------------------------------------------------------------------------
22
// Copyright 2021 The Dapr Authors
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -11,23 +11,31 @@
1111
// limitations under the License.
1212
// ------------------------------------------------------------------------
1313

14-
namespace DaprDemoActor
14+
using DaprDemoActor;
15+
using Microsoft.AspNetCore.Builder;
16+
using Microsoft.Extensions.DependencyInjection;
17+
using Microsoft.Extensions.Hosting;
18+
19+
var builder = WebApplication.CreateBuilder(args);
20+
21+
builder.Services.AddSingleton<BankService>();
22+
builder.Services.AddActors(options =>
1523
{
16-
using Microsoft.AspNetCore.Hosting;
17-
using Microsoft.Extensions.Hosting;
24+
options.Actors.RegisterActor<DemoActor>();
25+
});
1826

19-
public class Program
20-
{
21-
public static void Main(string[] args)
22-
{
23-
CreateHostBuilder(args).Build().Run();
24-
}
27+
var app = builder.Build();
2528

26-
public static IHostBuilder CreateHostBuilder(string[] args) =>
27-
Host.CreateDefaultBuilder(args)
28-
.ConfigureWebHostDefaults(webBuilder =>
29-
{
30-
webBuilder.UseStartup<Startup>();
31-
});
32-
}
29+
if (app.Environment.IsDevelopment())
30+
{
31+
app.UseDeveloperExceptionPage();
3332
}
33+
else
34+
{
35+
app.UseHsts();
36+
}
37+
38+
app.UseRouting();
39+
app.MapActorsHandlers();
40+
41+
await app.RunAsync();

examples/Actor/DemoActor/Startup.cs

Lines changed: 0 additions & 59 deletions
This file was deleted.

0 commit comments

Comments
 (0)