Files
AgileConfig/AgileConfig.Server.Data.Repository/ServiceCollectionExt.cs
T
2019-02-12 01:02:41 +08:00

21 lines
532 B
C#

using AgileConfig.Server.Common;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using System.Text;
namespace AgileConfig.Server.Data.Repository
{
public static class ServiceCollectionExt
{
public static void AddAgileConfigDb(this IServiceCollection sc)
{
sc.AddScoped<ISqlContext, AgileConfigDbContext>();
using (var ctx = new AgileConfigDbContext())
{
ctx.InitTables();
}
}
}
}