25 lines
647 B
C#
25 lines
647 B
C#
using JOBot.Backend.DAL.Context;
|
|
using JOBot.Backend.Services.gRPC;
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
public class Startup
|
|
{
|
|
public Startup(IConfiguration configuration)
|
|
{
|
|
Configuration = configuration;
|
|
}
|
|
|
|
public IConfiguration Configuration { get; }
|
|
|
|
public void ConfigureServices(IServiceCollection services)
|
|
{
|
|
services.AddGrpc();
|
|
services.AddDbContext<AppDbContext>(options =>
|
|
options.UseNpgsql(Configuration.GetConnectionString("PostgreSQL")));
|
|
}
|
|
|
|
public void Configure(WebApplication app, IWebHostEnvironment env)
|
|
{
|
|
app.MapGrpcService<UserService>();
|
|
}
|
|
} |