using System;
using System.Data.Entity;
using System.Linq;

namespace Qusion.WebApp.Areas.Qusion.Models.Account
{
    public class UserContext : DbContext
    {
        public UserContext()
            : base("ApplicationServices")
        {
        }

        public DbSet<UserModel> UserProfiles { get; set; }

        public UserModel Get(string username)
        {
            return UserProfiles.SingleOrDefault(u => u.UserName == username);
        }

        public UserModel Get(Guid id)
        {
            return UserProfiles.SingleOrDefault(u => u.ID == id);
        }
    }
}