Préparation dans program des services
continuous-integration/drone/push Build is failing Details

pull/6/head
Leni BEAULATON 3 weeks ago
parent fee5b07fac
commit f7f0be36e5

@ -10,12 +10,12 @@ using System.Threading.Tasks;
namespace Contextlib namespace Contextlib
{ {
public class DbCommentManager : ICommentService<Commentary> public class DbCommentaryManager : ICommentService<Commentary>
{ {
private WTFContext _context; private WTFContext _context;
private GenericRepository<Commentary> _repo; private GenericRepository<Commentary> _repo;
public DbCommentManager(WTFContext context) public DbCommentaryManager(WTFContext context)
{ {
_context = context ?? throw new ArgumentNullException(nameof(context), "Database context cannot be null."); _context = context ?? throw new ArgumentNullException(nameof(context), "Database context cannot be null.");
_repo = new GenericRepository<Commentary>(context); _repo = new GenericRepository<Commentary>(context);

@ -8,12 +8,17 @@ using ServicesApi;
var builder = WebApplication.CreateBuilder(args); var builder = WebApplication.CreateBuilder(args);
//API //API
builder.Services.AddScoped<IUserService<UserDTO>, UserService>(); builder.Services.AddScoped<IUserService<UserDTO>, UserService>();
builder.Services.AddScoped<IQuoteService<QuoteDTO>, QuoteServiceStub>(); builder.Services.AddScoped<IQuoteService<QuoteDTO>, QuoteServiceStub>(); // Retirer "Stub"
//EF //EF
builder.Services.AddScoped<WTFContext, StubWTFContext>(); builder.Services.AddScoped<WTFContext, StubWTFContext>();
builder.Services.AddScoped<IUserService<Users>, DbUsersManager>(); builder.Services.AddScoped<IUserService<Users>, DbUsersManager>();
// builder.Services.AddScoped<IUserService<Quote>, DbQuoteManager>(); Quand DbQuoteManager sera présent
//builder.Services.AddScoped<IUserService<Character>, DbCharacterManager>();
//builder.Services.AddScoped<IUserService<Commentary>, DbCommentaryManager>();
//...
// Add services to the container. // Add services to the container.
builder.Services.AddControllers(); builder.Services.AddControllers();

Loading…
Cancel
Save