C# 11 - Required Members

แชร์
ฝัง
  • เผยแพร่เมื่อ 26 ธ.ค. 2024

ความคิดเห็น • 9

  • @CodingTutorialsAreGo
    @CodingTutorialsAreGo  2 ปีที่แล้ว +1

    Which features of C# 11 are you most interested in? Let me know in the comments.
    Source code available at: github.com/JasperKent/Required-Members
    Remember to subscribe at th-cam.com/channels/qWQzlUDdllnLmtgfSgYTCA.html
    And if you liked the video, click the 👍.

    • @JoseSilva-gt6zj
      @JoseSilva-gt6zj 2 ปีที่แล้ว +1

      Hey, Jasper! Your videos go deep into the subject! Could you talk about "ref fields and ref scoped variables"? Thank you for sharing them! 👏👏👏

    • @CodingTutorialsAreGo
      @CodingTutorialsAreGo  2 ปีที่แล้ว +1

      ​@@JoseSilva-gt6zj I'll put it on the list.

    • @JoseSilva-gt6zj
      @JoseSilva-gt6zj 2 ปีที่แล้ว +1

      @@CodingTutorialsAreGo Thank you, Jasper! 👍

  • @atakantuncer3213
    @atakantuncer3213 2 ปีที่แล้ว +1

    Great explanation as always!

  • @mechanism-o4h
    @mechanism-o4h 2 ปีที่แล้ว +1

    Hello! What's difference of [required] attribute and this feature?

    • @CodingTutorialsAreGo
      @CodingTutorialsAreGo  2 ปีที่แล้ว

      The [Required] attribute applies to properties in two situations: 1) in entity class (i.e. a class that relates to a DB table), 2) in a DTO being returned from a client - e.g. in MVC. In both those cases it means a value must be provided (i.e. the property cannot be null), but it doesn't say *when* the value must be provided. The 'required' keyword says when a value must be provided - during initialization - even though the value provided may be null. In C# language terms, the [Required] attribute is more like the non-nullable concept.

    • @CodingTutorialsAreGo
      @CodingTutorialsAreGo  2 ปีที่แล้ว +1

      Great question, by the way. Enough to inspire a video answer: th-cam.com/video/bAQ93kr7mFE/w-d-xo.html

  • @davidwhite2011
    @davidwhite2011 2 ปีที่แล้ว +1

    Barney Rubble!