Build a .NET SDK with OpenAPI and NSwag | .NET Conf 2022

แชร์
ฝัง
  • เผยแพร่เมื่อ 24 ม.ค. 2025

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

  • @tacci2568
    @tacci2568 ปีที่แล้ว

    Can you tell me how to acces the response status?

  • @mgbrain9675
    @mgbrain9675 ปีที่แล้ว

    I have a problem, it's about generating ApiException class. if we generate first openapi, no problem to generate this class but when we try to add second open api reference , generator doesn,t generate ApiException. How can I fix this bug?

  • @MaxiTB
    @MaxiTB 2 ปีที่แล้ว +4

    I'm pretty sure HttpClient is an IDisposable.
    Even tho this is a beginner tutorial (because it uses minimal API for the service), proper memory management should always be shown in tutorials to scare away managers from coding ;-)

    • @_torgeek9108
      @_torgeek9108 ปีที่แล้ว

      Lol, it sure is disposable until you the socket exhaustion headache shows its ugly head on your project if IHttpClientFactory is not used instead 😅

    • @MaxiTB
      @MaxiTB ปีที่แล้ว

      @@_torgeek9108 I don't see your point; not disposing HttpClient instances created via IHttpClientFactory is even worse because the connection pool relies on speed reclaiming of unused instances which is signaled with Dispose().

    • @ПавелФамильевич
      @ПавелФамильевич ปีที่แล้ว +2

      It's managed by DI and does NOT require manual disposal. Please learn you stuff before posting

    • @MaxiTB
      @MaxiTB ปีที่แล้ว

      @@ПавелФамильевич Yeah right, var client = new HttpClient(); automatically magically pulls out and manages the instance in the non existing service provider. Sounds about right, thanks for your wisdom Mr. Random-Clueless-Poster or LLM bot. Ah, it's always good to know my job is safe.