28 lines
654 B
C#
28 lines
654 B
C#
using Microsoft.EntityFrameworkCore;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using WinFormsApp4.Models;
|
|
|
|
namespace WinFormsApp4.Controllers
|
|
{
|
|
public class UserController
|
|
{
|
|
public Ispr2441PetrovNvGameshopContext _dbContext;
|
|
|
|
public UserController()
|
|
{
|
|
_dbContext = new Ispr2441PetrovNvGameshopContext();
|
|
}
|
|
|
|
public User? Authorize(string username, string password)
|
|
{
|
|
return _dbContext.Users
|
|
.FirstOrDefault(u => u.Username == username && u.Password == password);
|
|
}
|
|
|
|
}
|
|
}
|