A database based on .net
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
1.6 KiB

// Author: Simon Gockner
// Created: 2020-02-08
// Copyright(c) 2020 SimonG. All Rights Reserved.
using CoreWCF;
using CoreWCF.Configuration;
using GBase.Api.Services;
using GBase.Server.Services;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
namespace GBase.Server
{
public class Startup
{
private readonly IConfiguration _configuration;
public Startup(IConfiguration configuration)
{
_configuration = configuration;
}
public void ConfigureServices(IServiceCollection services)
{
services.AddServiceModelServices();
}
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
app.UseServiceModel(builder =>
{
builder.AddService<GBaseService>();
builder.AddServiceEndpoint<GBaseService, IGBaseService>(new BasicHttpBinding(), _configuration[GBaseServerSettings.GBASE_ENDPOINT_STARTUP_CONFIGURATION_PREFIX]);
builder.AddService<GBaseTableService>();
builder.AddServiceEndpoint<GBaseTableService, IGBaseTableService>(new BasicHttpBinding(), _configuration[GBaseServerSettings.GBASE_TABLE_ENDPOINT_STARTUP_CONFIGURATION_PREFIX]);
builder.AddService<GBaseColumnService>();
builder.AddServiceEndpoint<GBaseColumnService, IGBaseColumnService>(new BasicHttpBinding(), _configuration[GBaseServerSettings.GBASE_COLUMN_ENDPOINT_STARTUP_CONFIGURATION_PREFIX]);
});
}
}
}