public async Task <Response> AddCourse(Owner owner, Course course) { Response response = new Response(); try { ValidationResult validationResponse = await new CourseValidator().ValidateAsync(course); if (!validationResponse.IsValid) { response.Success = false; response.ErrorList.Add("Validation Error"); return(response); } response = await _OwnerRepo.AddCourse(owner, course); return(response); } catch (Exception e) { StringBuilder sb = new StringBuilder(); log.Error(sb.AppendLine(e.Message).AppendLine(e.StackTrace).ToString()); response.Success = false; response.ErrorList.Add("Erro While adding course"); return(response); } }