removes duplicates
This commit is contained in:
parent
d61c096f69
commit
63913b432c
|
|
@ -1,45 +0,0 @@
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Net;
|
|
||||||
using System.Net.Http;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
using Microsoft.Extensions.Logging;
|
|
||||||
using ProjectGrid.Data;
|
|
||||||
|
|
||||||
namespace ProjectGrid.Controllers
|
|
||||||
{
|
|
||||||
[ApiController]
|
|
||||||
public class UsersController : ControllerBase
|
|
||||||
{
|
|
||||||
|
|
||||||
private readonly ILogger<UsersController> _logger;
|
|
||||||
|
|
||||||
//static readonly Models.IUserRepository repository = new Models.UserRepository();
|
|
||||||
private readonly Models.IUserRepository repository;
|
|
||||||
|
|
||||||
public UsersController(ILogger<UsersController> logger, DataAccessContext context)
|
|
||||||
{
|
|
||||||
_logger = logger;
|
|
||||||
repository = context;
|
|
||||||
}
|
|
||||||
|
|
||||||
[HttpGet]
|
|
||||||
[Route("api/users")]
|
|
||||||
public IEnumerable<Models.UserModel> GetAllUsers()
|
|
||||||
{
|
|
||||||
return repository.GetAll();
|
|
||||||
}
|
|
||||||
|
|
||||||
[HttpPost]
|
|
||||||
[Route("api/user")]
|
|
||||||
[Consumes("application/json")]
|
|
||||||
public Models.UserModel PostUser(Models.UserModel item)
|
|
||||||
{
|
|
||||||
return repository.Add(item);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
namespace ProjectGrid.Models
|
namespace ProjectGrid.Models
|
||||||
{
|
{
|
||||||
public class TttMove
|
public class TicTacTocBoard
|
||||||
{
|
{
|
||||||
public int Id { get; set; }
|
public int Id { get; set; }
|
||||||
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
namespace ProjectGrid.Models
|
namespace ProjectGrid.Models
|
||||||
{
|
{
|
||||||
public class TttBoard
|
public class TicTacTocMove
|
||||||
{
|
{
|
||||||
public int Id { get; set; }
|
public int Id { get; set; }
|
||||||
|
|
||||||
Loading…
Reference in New Issue