-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStartup.cs
More file actions
22 lines (19 loc) · 978 Bytes
/
Startup.cs
File metadata and controls
22 lines (19 loc) · 978 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
using Azure.Data.Tables;
using BugTrackerCPAPI.Models;
using BugTrackerCPAPI.Repositories;
using Microsoft.Azure.Functions.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection;
[assembly: FunctionsStartup(typeof(BugTrackerCPAPI.Startup))]
namespace BugTrackerCPAPI
{
public class Startup : FunctionsStartup
{
public override void Configure(IFunctionsHostBuilder builder)
{
var bugsClient = new AbstractTableClient<BugEntity>(new TableClient("UseDevelopmentStorage=true", "Bug"));
var assigneeClient = new AbstractTableClient<AssigneeEntity>(new TableClient("UseDevelopmentStorage=true", "Assignee"));
builder.Services.AddTransient<IAssigneeRepository, AssigneeRepository>(x => new AssigneeRepository(assigneeClient));
builder.Services.AddTransient<IBugRepository, BugRepository>(x => new BugRepository(bugsClient, new AssigneeRepository(assigneeClient)));
}
}
}