guard clause 썸네일형 리스트형 [C#] Guard Clause public static void SampleMethod(int[] array, int index, Span span, string text) { if (array is null) { throw new ArgumentNullException(nameof(array), "The array must not be null"); } if (array.Length >= 10) { throw new ArgumentException($"The array must have less than 10 items, had a size of {array.Length}", nameof(array)); } if (index = array.Length) { throw new ArgumentOutOfRange.. 더보기 이전 1 다음