shopping-assistant-api/ShoppingAssistantApi.Persistance/PersistanceExtentions/RepositoriesExtention.cs
2023-09-22 23:02:20 +03:00

20 lines
636 B
C#

using Microsoft.Extensions.DependencyInjection;
using ShoppingAssistantApi.Application.IRepositories;
using ShoppingAssistantApi.Persistance.Database;
using ShoppingAssistantApi.Persistance.Repositories;
namespace ShoppingAssistantApi.Persistance.PersistanceExtentions;
public static class RepositoriesExtention
{
public static IServiceCollection AddInfrastructure(this IServiceCollection services)
{
services.AddSingleton<MongoDbContext>();
services.AddScoped<IRolesRepository, RolesRepository>();
services.AddScoped<IUsersRepository, UsersRepository>();
return services;
}
}