자주 사용되는 메소드들
자주 사용되는 메소드들
자주 사용되는 메소드들
자주 사용되는 메소드들
public bool TryToEnroll(int studentId, int courseId, out string errorMessage) { errorMessage = string.Empty; var isAny = _courseRepository.IsAnyEntrollment(studentId, courseId); if (isAny) { errorMessage = "You are already enrolled in this course"; return(false); } _courseRepository.CreateEnrollment(studentId, courseId); return(true); }