I'm refactoring a block code and wanted to use constructor injection for my services. So far i get null exceptions for my services ( prob because i don't have a container yet). Anyone a idea how i implement this?
namespace RampantRobots_NextLvl
{
class Program
{
private static IBoardService _boardService;
private static IPlayerService _playerService;
public Program(IBoardService boardService,IPlayerService playerService)
{
_boardService = boardService;
_playerService = playerService;
}
static void Main(string[] args)
{
var player = _playerService.Create(1, 1);
var board = _boardService.Create(5,10,3,3,player);
_boardService.Draw(player, board);
_boardService.MovePlayer(player, board);
Console.ReadLine();
}
}
}