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); }
public HelpdeskRepository(helpdeskContext context = null) { _db = context != null ? context : new helpdeskContext(); }