using Silk_Road_Api.DatabaseContext;
using Silk_Road_Api.Models;

namespace Silk_Road_Api.Repositories
{
    public class UserRepository : Repository, IUserRepository
    {

        public UserRepository(SilkRoadApiContext context) : base(context) { }

        public User? GetUserByUsername(string username)
        {
            return _context.Users.Where(u => u.username.Equals(username)).FirstOrDefault();
        }

        public User? GetUserByUsernameAndPassword(string username, string password)
        {
            return _context.Users.Where(u => u.username.Equals(username) && u.password.Equals(password)).FirstOrDefault();   }
    }
}
