Exemplo n.º 1
0
        /// <summary>
        /// --  Get employee by name --
        /// </summary>
        /// <param name="name"></param>
        /// <returns>Employee</returns>
        public Employee GetByName(string name)
        {
            var employee = _employees.Where(
                empl => empl.EmployeName == name
                ).FirstOrDefault();

            return(RepositoryHelpper.ManageResult(employee));
        }
Exemplo n.º 2
0
        /// <summary>
        /// --  Get employee by id  --
        /// </summary>
        /// <param name="id"></param>
        /// <returns>Employee</returns>
        public Employee GetById(int id)
        {
            int realId = Convert.ToInt32(id);

            var employee = _employees.Where(
                empl => empl.EmployeeId == realId
                ).FirstOrDefault();

            return(RepositoryHelpper.ManageResult(employee));
        }