public ActionResult CreateDate(Dates request) { if (request.IdPatientJs == null || request.IdPatientJs == "") { Patients patients = new Patients(request.Dni, request.FirstName, request.LastName); Response <Patients> resultPatients = ipatient.CreatePatient(patients); if (resultPatients.Success) { request.IdPatient = resultPatients.Data.Id; } else { return(Ok(resultPatients)); } } else { request.IdPatient = new Guid(request.IdPatientJs); } request.IdService = new Guid(request.IdServiceJs); Response <Dates> result = idate.CreateDate(request); return(Ok(result)); }