public async Task <ActionResult> Create(FacultyViewModel facultyViewModel) { var existingCode = await _facultyService.FindByCode(facultyViewModel.Code); if (existingCode == null) { var faculty = new Faculty { Code = facultyViewModel.Code, Name = facultyViewModel.Name }; await _facultyService.Create(faculty); return(Ok()); } else { return(BadRequest("Ya existe una Facultad con este codigo")); } }