Skip to content
Snippets Groups Projects
Commit a3745341 authored by thest's avatar thest
Browse files

Remplacement de la classe Service par la classe GameControleur

parent 81317968
Branches
No related merge requests found
......@@ -6,7 +6,7 @@ namespace fichier1.Controllers
{
class GameController
public class GameController : IGameController
{
public GameController()
{
......
namespace fichier1.Controllers
{
public interface IGameController
{
string[] getCorrection(int nb);
int getCurrentWordNumber();
string[] getMot(int nb);
string[] getMotSuivant();
int getTotalWordNumber();
void validerMot(string[] mot);
}
}
\ No newline at end of file
using fichier1.Data;
using System.Collections.Generic;
namespace fichier1
{
public interface IService
{
}
}
\ No newline at end of file
......@@ -9,6 +9,7 @@ using System.IO;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using fichier1.Controllers;
namespace fichier1
{
......@@ -33,7 +34,7 @@ namespace fichier1
Application.SetCompatibleTextRenderingDefault(false);
//serviceCollection.AddSingleton<Form1>();
serviceCollection.AddScoped<IService, Service>();
serviceCollection.AddScoped<IGameController, GameController>();
ServiceProvider = serviceCollection.BuildServiceProvider();
ServiceProvider.GetRequiredService<BddContext>().Database.EnsureCreated();
......
using fichier1.Data;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace fichier1
{
public class Service : IService
{
private readonly BddContext context;
public Service(BddContext context)
{
this.context = context;
}
}
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment