Example #1
0
        public async Task <ActionResult <IEnumerable <Employee> > > Search(string name, Gender?gender)
        {
            try
            {
                var result = await employeeRepsitory.Search(name, gender);

                if (result.Any())
                {
                    return(Ok(result));
                }

                return(NotFound());
            }
            catch (Exception)
            {
                return(StatusCode(StatusCodes.Status500InternalServerError,
                                  "Error retrieving data from the database"));
            }
        }