Exemple #1
0
        public ActionResult <Employee> GetEmployeeByEmail(string email)
        {
            var emailAddress = fs(C3.createEmailAddress(email));

            if (emailAddress.IsNone)
            {
                return(BadRequest("Invalid email address"));
            }
            else
            {
                return(fs(C3.getEmployeeFromDatabase(_db, email))
                       .Map(e => (ActionResult <Employee>)Ok(e))
                       .IfNone(() => NotFound()));
            }
        }