Add project files.

This commit is contained in:
Sergio Matias Urquin
2025-04-29 18:42:29 -06:00
parent 9c1958d351
commit 83fc1878c4
67 changed files with 4586 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
using Azure.Identity;
using Core.Blueprint.DAL.SQLServer;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
namespace Core.Blueprint.SQLServer.Configuration
{
/// <summary>
/// Provides extension methods for configuring SQL Server.
/// </summary>
public static class RegisterBlueprint
{
/// <summary>
/// Configures SQL Server services, including the database context and generic repository, for dependency injection.
/// </summary>
/// <param name="services">The service collection to which the SQL Server services will be added.</param>
/// <param name="configuration">The application configuration object for accessing settings such as connection strings.</param>
/// <returns>An updated <see cref="IServiceCollection"/> with SQL Server services registered.</returns>
public static IServiceCollection AddSQLServer(this IServiceCollection services, IConfiguration configuration)
{
var chainedCredentials = new ChainedTokenCredential(
new ManagedIdentityCredential(),
new SharedTokenCacheCredential(),
new VisualStudioCredential(),
new VisualStudioCodeCredential()
);
services.AddScoped(typeof(IEntityRepository<,>), typeof(EntityRepository<,>));
return services;
}
}
}