Skip to content

Commit

Permalink
#1 Adds Quiz model
Browse files Browse the repository at this point in the history
  • Loading branch information
BerendWouters committed Sep 11, 2018
1 parent a63c74f commit ebfbd0e
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 0 deletions.
7 changes: 7 additions & 0 deletions QuizMaster/Controllers/Base/CRUDControllerBase.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
using System;
using System.Threading.Tasks;
using API.Services.Interfaces;
using Microsoft.AspNetCore.Mvc;
using QuizMaster.Shared.Models.Base;

namespace QuizMaster.Controllers.Base
{
public abstract class CRUDControllerBase<T> : Controller where T : IModel
{
protected readonly IDataService<T> _dataService;

public CRUDControllerBase(IDataService<T> dataService)
{
_dataService = dataService;
}
public virtual async Task<ActionResult> Create(T model)
{
throw new NotImplementedException();
Expand Down
1 change: 1 addition & 0 deletions QuizMaster/QuizMaster.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\API.Services\API.Services.csproj" />
<ProjectReference Include="..\Shared\Shared.csproj" />
</ItemGroup>

Expand Down
3 changes: 3 additions & 0 deletions QuizMaster/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using API.Services.Interfaces;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using QuizMaster.Shared.Models;

namespace QuizMaster
{
Expand All @@ -25,6 +27,7 @@ public Startup(IConfiguration configuration)
public void ConfigureServices(IServiceCollection services)
{
services.AddMvc();
services.AddSingleton<IDataService<Quiz>>();
}

// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
Expand Down
12 changes: 12 additions & 0 deletions Shared/Models/Quiz.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Text;
using QuizMaster.Shared.Models.Base;

namespace QuizMaster.Shared.Models
{
public class Quiz : IModel
{
public int Id { get; set; }
}
}

0 comments on commit ebfbd0e

Please sign in to comment.