Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. The Insider News
  4. Introduction to ASP.NET Core Minimal APIs

Introduction to ASP.NET Core Minimal APIs

Scheduled Pinned Locked Moved The Insider News
csharpasp-netjsondotnetcom
5 Posts 4 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    TheGreatAndPowerfulOz
    wrote on last edited by
    #1

    Introduction to ASP.NET Core Minimal APIs[^]

    Quote:

    In recent .NET versions, there’s a new way to build JSON-based APIs with ASP.NET Core: Minimal APIs.

    I thought "Minimal APIs" have been around a while. Did a quick search in "Insider News" for "Minimal API" and found several mentions going back a few years. Maybe it's d different this time around because of "top level" ( X|) statements?

    #SupportHeForShe Government can give you nothing but what it takes from somebody else. A government big enough to give you everything you want is big enough to take everything you've got, including your freedom.-Ezra Taft Benson You must accept 1 of 2 basic premises: Either we are alone in the universe or we are not alone. Either way, the implications are staggering!-Wernher von Braun

    Richard DeemingR M 2 Replies Last reply
    0
    • T TheGreatAndPowerfulOz

      Introduction to ASP.NET Core Minimal APIs[^]

      Quote:

      In recent .NET versions, there’s a new way to build JSON-based APIs with ASP.NET Core: Minimal APIs.

      I thought "Minimal APIs" have been around a while. Did a quick search in "Insider News" for "Minimal API" and found several mentions going back a few years. Maybe it's d different this time around because of "top level" ( X|) statements?

      #SupportHeForShe Government can give you nothing but what it takes from somebody else. A government big enough to give you everything you want is big enough to take everything you've got, including your freedom.-Ezra Taft Benson You must accept 1 of 2 basic premises: Either we are alone in the universe or we are not alone. Either way, the implications are staggering!-Wernher von Braun

      Richard DeemingR Offline
      Richard DeemingR Offline
      Richard Deeming
      wrote on last edited by
      #2

      If you're interested in the guts of how they work, Andrew Lock posted an excellent eight-part blog series with the gory details: A first look behind the scenes of minimal API endpoints[^]


      "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

      "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

      1 Reply Last reply
      0
      • T TheGreatAndPowerfulOz

        Introduction to ASP.NET Core Minimal APIs[^]

        Quote:

        In recent .NET versions, there’s a new way to build JSON-based APIs with ASP.NET Core: Minimal APIs.

        I thought "Minimal APIs" have been around a while. Did a quick search in "Insider News" for "Minimal API" and found several mentions going back a few years. Maybe it's d different this time around because of "top level" ( X|) statements?

        #SupportHeForShe Government can give you nothing but what it takes from somebody else. A government big enough to give you everything you want is big enough to take everything you've got, including your freedom.-Ezra Taft Benson You must accept 1 of 2 basic premises: Either we are alone in the universe or we are not alone. Either way, the implications are staggering!-Wernher von Braun

        M Offline
        M Offline
        Marc Clifton
        wrote on last edited by
        #3

        if (result is Ok { Value : { } } hugged)
        hugged.Value.Timestamp = DateTime.UtcNow;

        I've never seen that syntax. :omg:

        Latest Articles:
        A Lightweight Thread Safe In-Memory Keyed Generic Cache Collection Service A Dynamic Where Implementation for Entity Framework

        Richard DeemingR S 2 Replies Last reply
        0
        • M Marc Clifton

          if (result is Ok { Value : { } } hugged)
          hugged.Value.Timestamp = DateTime.UtcNow;

          I've never seen that syntax. :omg:

          Latest Articles:
          A Lightweight Thread Safe In-Memory Keyed Generic Cache Collection Service A Dynamic Where Implementation for Entity Framework

          Richard DeemingR Offline
          Richard DeemingR Offline
          Richard Deeming
          wrote on last edited by
          #4

          It would arguably be better to use:

          if (result is Ok<Hugged> { Value: { } hugged })
          hugged.Timestamp = DateTime.UtcNow;

          Patterns - Pattern matching using the is and switch expressions. | Microsoft Learn[^]


          "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

          "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

          1 Reply Last reply
          0
          • M Marc Clifton

            if (result is Ok { Value : { } } hugged)
            hugged.Value.Timestamp = DateTime.UtcNow;

            I've never seen that syntax. :omg:

            Latest Articles:
            A Lightweight Thread Safe In-Memory Keyed Generic Cache Collection Service A Dynamic Where Implementation for Entity Framework

            S Offline
            S Offline
            snorkie
            wrote on last edited by
            #5

            Its gross to me. Feels like we're trying to turn C# into Perl.

            Hogan

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups