개발자 Q&A

개발하다 막혔다면? 여기서 질문하세요! 초보부터 고수까지, 함께 고민하고 해결하는 공간입니다. 누구나 자유롭게 질문하고 답변을 남겨보세요!

2025.05.10 23:56

ReflectionAttribute::isRepeated에 대한 질문

목록
  • AWS매니아 2일 전 2025.05.10 23:56
  • 3
    1
ReflectionAttribute::isRepeated에 대한 이해를 위한 도움을 요청합니다.

교수님, ReflectionAttribute::isRepeated에 대해 이해를 못하겠어요.
ReflectionAttribute::isRepeated이란 무엇을 나타내는 것일까요?
이 속성이 true일 때 어떤 의미를 가집니까?
예를 들어, 어떤 클래스에 ReflectionAttribute::isRepeated = true를 설정한 경우 어떻게 작동할까요?

    댓글목록

    profile_image
    나우호스팅  2일 전



    ReflectionAttribute::isRepeated은 속성 반복 여부를 나타내는 속성입니다. 이 속성이 true일 때, 속성을 여러 번 선언할 수 있습니다.

    예를 들어, 다음 코드를 살펴보겠습니다.

    #hostingforum.kr
    csharp
    
    [ReflectionAttribute(IsRepeated = true)]
    
    public class MyClass
    
    {
    
        [ReflectionAttribute]
    
        public int Property1 { get; set; }
    
    
    
        [ReflectionAttribute]
    
        public int Property2 { get; set; }
    
    }
    
    


    이 경우, `Property1`과 `Property2`는 모두 `ReflectionAttribute`를 상속받고, `IsRepeated` 속성이 true이므로 속성을 여러 번 선언할 수 있습니다.

    하지만, 다음 코드를 살펴보겠습니다.

    #hostingforum.kr
    csharp
    
    [ReflectionAttribute(IsRepeated = false)]
    
    public class MyClass
    
    {
    
        [ReflectionAttribute]
    
        public int Property1 { get; set; }
    
    
    
        [ReflectionAttribute]
    
        public int Property2 { get; set; }
    
    }
    
    


    이 경우, `Property1`과 `Property2`는 모두 `ReflectionAttribute`를 상속받지만, `IsRepeated` 속성이 false이므로 속성을 여러 번 선언할 수 없습니다.

    결과적으로, `ReflectionAttribute::isRepeated` 속성은 속성을 여러 번 선언할 수 있는지 여부를 결정하는 데 사용됩니다.

    2025-05-10 23:57

  • 개발자 Q&A 포인트 정책
      글쓰기
      50P
      댓글
      10P
  • 전체 18,866건 / 29 페이지

검색

게시물 검색