public async Task <IActionResult> Run(
            [HttpTrigger(AuthorizationLevel.Function, "post", Route = "Applicants/ApplicantAdd")] HttpRequest req,
            ILogger log)
        {
            Core.Entities.Applicant applicantInserted = null;
            try
            {
                var applicant = JsonConvert.DeserializeObject <Core.Entities.Applicant>(await new StreamReader(req.Body).ReadToEndAsync());

                applicant.CreatedOnDate = DateTime.UtcNow;

                var applicantId = await _applicantRepository.AddItemAsync(applicant);

                applicantInserted = await _applicantRepository.GetItemAsync(new Guid(applicantId));
            }
            catch (Exception ex)
            {
                // TODO send 400 errors if it's the case, otherwise send 500.
                return(new StatusCodeResult(500));

                // TO DO (add logger)
                throw ex;
            }
            return(new OkObjectResult(applicantInserted));
        }
        public async Task <IActionResult> Run(
            [HttpTrigger(AuthorizationLevel.Function, "get", Route = "Applicants/ApplicationGetById/{id}")] HttpRequest req, string id,
            ILogger log)
        {
            try
            {
                var applicant = await _applicantRepository.GetItemAsync(new Guid(id));

                if (applicant == null)
                {
                    return(new NotFoundObjectResult(id));
                }
                return(new OkObjectResult(applicant));
            }
            catch (Exception ex)
            {
                // TODO Handle exception
                return(new StatusCodeResult(500));;
            }
        }