KalkulatorISP-31rrrrr/source/repos/WinFormsApp4/Controllers/UserController.cs
2025-11-11 14:18:33 +04:00

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);
}
}
}