예제 #1
0
        public Employees GetByEmail(string email)
        {
            Employees selectedEmployee = null;

            try
            {
                helpdeskContext _db = new helpdeskContext();
                selectedEmployee = _db.Employees.FirstOrDefault(emp => emp.Email == email);
            }
            catch (Exception ex)
            {
                Console.WriteLine("Problem in " + GetType().Name + " " + MethodBase.GetCurrentMethod().Name + " " + ex.Message);
                throw ex;
            }

            return(selectedEmployee);
        }
예제 #2
0
 public HelpdeskRepository(helpdeskContext context = null)
 {
     _db = context != null ? context : new helpdeskContext();
 }