Skip to content

Commit

Permalink
dependancy injection for lobbyService
Browse files Browse the repository at this point in the history
  • Loading branch information
shammill committed Jun 1, 2019
1 parent bf0b317 commit 772c44d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Shammill.LobbyManager/Controllers/LobbyController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,19 @@
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Shammill.LobbyManager.Services.Interfaces;

namespace Shammill.LobbyManager.Controllers
{
[Route("api/[controller]")]
public class LobbyController : Controller
{
ILobbyService lobbyService;
public LobbyController(ILobbyService lobbyService)
{
this.lobbyService = lobbyService;
}

// GET api/values
[HttpGet]
public IEnumerable<string> Get()
Expand Down
3 changes: 3 additions & 0 deletions Shammill.LobbyManager/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using Shammill.LobbyManager.Services;
using Shammill.LobbyManager.Services.Interfaces;

namespace Shammill.LobbyManager
{
Expand All @@ -24,6 +26,7 @@ public Startup(IConfiguration configuration)
public void ConfigureServices(IServiceCollection services)
{
services.AddMvc();
services.AddScoped<ILobbyService, LobbyService>();
}

// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
Expand Down

0 comments on commit 772c44d

Please sign in to comment.