model and Dto
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
|
||||
|
||||
using Hushian.Application.Contracts.Persistence;
|
||||
using Hushian.Persistence.Repositories;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using System.Reflection;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace Hushian.Persistence
|
||||
{
|
||||
public static class PersistenceServicesRegistration
|
||||
{
|
||||
public static IServiceCollection ConfigurePersistenceServices(this IServiceCollection services,
|
||||
IConfiguration configuration)
|
||||
{
|
||||
services.AddDbContext<HushianDbContext>(options =>
|
||||
{
|
||||
options.UseSqlServer(configuration
|
||||
.GetConnectionString("MainConnectionString"));
|
||||
});
|
||||
services.AddScoped(typeof(IGenericRepository<>), typeof(GenericRepository<>));
|
||||
|
||||
|
||||
return services;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user