Test EF / Mysql

This commit is contained in:
2018-10-05 00:18:37 +02:00
parent 5a690e4dbe
commit d2c1a9d5f9
7 changed files with 76 additions and 3 deletions

View File

@@ -2,6 +2,8 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using LaDOSE.Api.Context;
using LaDOSE.Entity;
using Microsoft.AspNetCore.Mvc;
namespace LaDOSE.Api.Controllers
@@ -10,11 +12,20 @@ namespace LaDOSE.Api.Controllers
[ApiController]
public class ConfigController : ControllerBase
{
private readonly LaDOSEDbContext _db;
public ConfigController(LaDOSEDbContext db)
{
_db = db;
}
// GET api/Config
[HttpGet]
public ActionResult<IEnumerable<string>> Get()
public ActionResult<IEnumerable<Game>> Get()
{
return new string[] { "value1", "value2" };
return _db.Game.ToList();
}
// GET api/Config/5