ASP.NET Community Standup - Minimal APIs

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] so [Music] do [Music] [Music] [Applause] [Music] [Music] well hello hello wow david disappeared trust us david there we go it is a party um so i'm john galloway i'm a pm on the dot net community team uh this is the platnet community stand up we are welcoming back damien edwards it's good to see you again thank you very much good to see you all as well uh we we have david fowler and stephen halter on to talk about minimal api and there's been a lot of cool discussion going on with this just on on twitter and you guys have been showing off some really cool stuff you've been working on i'm excited to see it but before we jump into that cliffhanger i always love the community and i'm going to just go off the wonderful community link and i'll hear that let me um somebody told me that john loves community it's all true it's all true i um had some links already kind of planned and then i went and let me see and then i went and asked around on twitter last night before i went to bed hey anyone got any favorite community links and then i woke up this morning and i had a bunch more to add so we'll see how fast i can talk so here's all the links um and i've also sent them in the comments uh andrew lock it's the weekly andrew lock show andrew actually posted this last week this is on uh open source ecommerce platform not commerce and one of the things that i just one of the reasons i'm sharing the snop commerce has been around for a long time it's really cool when open source projects like this keep going and keep building cool stuff and specifically not commerce what he's showing here is using in docker but if you are looking for you know i see people building uh like their own e-commerce systems i even when i used to work on the mvc music store i would get desperate you know like requests from people who had built stores running on mvc music store which frightened me um but if you're going to build an e-commerce solution like check out something like uh not commerce one of the things that's neat about knopcommers is it is a something that you can plug in at a smaller level so a lot of these store kind of systems basically you are running inside of that application and then you can like plug into it but you are kind of subservient to that system and not commerce has a way where you can also just kind of plug it in more modularly so it's just kind of a standard walkthrough showing hooking it up in this case he's running with postgres and just showing off the things the initial uh the initial screen and then you can go through and configure all your your products etc so that's just a you know quick look at exploring the application and a good reminder to me i've i don't know how far back knob commerce goes but it's it's a it's a cool product as uh mahesh calls out uh in the comments too there's also simple commerce i think we've mentioned them before too there's a lot of really good systems out there but definitely i wouldn't start from scratch if i was building a an e-commerce store uh here's one with a nice overlay i saw this come in yesterday this is neat uh just saw this announce microsoft joining the bytecode alliance for webassembly technology so this includes fastly intel mozilla so this is a write-up in visual studio magazine and the reason i'm including this one is because it actually kind of talks through some of the things that explains it um after i saw this i dug around for more of a press release and the press releases were not as wonderful um but so here's uh you know here's talking about what it is and then also um things like the uh talks about some of the projects that are in the alliance's github repository so there's some something shared out there and here's the official announcement from the mozilla thing and this is more press release style but just talking about that announcement so that's cool that's about all i know of it i hadn't heard actually anything more internally at microsoft but i'm the same i saw that announcement this last week but uh i haven't heard anything oh can you talk about it i'm in the know huh nothing really not really not yet okay still new we we care about why zone we care about blazer.net um but nothing nothing concrete yet okay feeling around still all right uh let me see here's uh just a second in the series um from david he's talking about a chip emulator for c-sharp and blazer um so last week i showed off playing pong and tank and all this stuff in the browser with blazer and this is actually running uh chip8 images uh so here he kind of gets a little more into it talking about like actually scanning and drawing pixels and stuff on the screen he's using a canvas what's what's kind of nice with this series these are all pretty short so these are you know it's just kind of a quick hey we're looking at this thing this week and so here is he's showing just rendering a frame so um these are these are nice quick just uh while you're uh you know checking your email or something or waiting for your code to compile you can you can read these pretty quickly all right this is not one of those of course because jeremy writes comprehensive blog posts so this is looking at multi-tenancy and ef core with blazer server so uh so here you know all the things uh and this is something that when i've looked at before multi-tenancy with uf core this is something where you you know it takes some work especially to get it right make sure you're not leaking information from one client to another um so here he just kind of talks about setting that up and uh and looking you know looking at the different context etc so good stuff i'm gonna go fast because i got a lot uh curious drive pointed out to me that uh he's got uh several different playlists including almost 60 on blazer so he's got 60 blazer tutorials and 60 uh so 60 c-sharp and and 60 web assembly more focused um so and of course i get the ads and i don't want to see the ads and i don't want um the um prime subscribe or this subscription either but just trust me there are so many of these tutorials so um i looked through some these there's some you know pretty good level of information and they're all at about 20 minutes half hour so all right on to the next uh david brock talking about making microservices fun again with dapper so i've been looking a little bit more at dapper lately and we've had some good posts on this um so he's talking about just kind of what dapper is and how it fits in with microservices and i'd initially kind of like concept overload i'd kind of focus more on like i'm just going to do tai and docker and just kind of like not really look at dapper and over time lately i've been looking a little bit more at some of the things that dapper does for you um sorry you know talks about comparing with with service mesh and pub sub etc i don't know any comments on on dapper at all from you folks super cool try it out all right cool um let me see speaking of that sort of thing pub sub uh so there's azure web pub zone yeah i know you got you have thoughts here david as your website so i understand my understanding from reading this and then also following from your tweet so we had azure signal our service and azure signal our service has all the things with like the fallback and does you know like works with uh the smaller clients yeah yep and where whereas pub sub is just like it's just a pub sub websocket back end and that's all yeah yeah it's it's so i i think that so funny i had to repeat this about 10 times in the last week um bring your own websocket library it's kind of the main the main point of it so you can run any clan that has websockets a device um we don't have signalr clients for everything um and the signature client kind of adds stuff on top uh a protocol streaming different calling conventions this is more lightweight it is the raw web socket layer plus a service back-end so i can have my my app running with an http server on any platform any language and then you can connect via a website in in any language and you can and you can have that um handle for you um via azure web pops up it's kind of like the the guts of signal are kind of like torn to bits and put into a service yeah i've worked a lot on single eye with david and i was just chatting with him last friday asking like why did this other azure team like steal our idea david's like you know this is our thing right so i should have been paying more attention to the cool twitter all right uh let me see so this is graph graphql link uh and so just i don't know there's there's some cool libraries and stuff out there for graphql this one is just one that provides a link interface so being able to uh link queries into your graphql backend stuff so thank you for that georgie all right uh ash mind who also does the um uh what is it source um that's the sharp lab sharp top that's right we all use every day i know sharp lab is amazing by the way shark fly like here if i haven't showed that sharp lab dot io i was trying to sponsor him but does that have a link on github yeah yeah so i mean you can like try out all the different like things things that are like still in the works and all kinds of different features and stuff so it's amazing shows the jitted code the it's nuts yeah and yeah exactly it shows all that and you can see like you know il and jit assembly and syntax tree and all kinds of business so neat stuff so are you gonna use this david to show off the uh the middle code no i might run into my of course it's nvs running my machine's on fire from last night nice well this is another thing this is another thing from him so this is source mock it's a source generator uh so it's a mocking framework built on top of source generators so i just thought that's kind of neat like being able to like not clutter your code up with a bunch of mocking code this is something where it can just set up you know mocks for you so very lightweight i love this kind of feel of like hey it's important code but it's not code i want to re write and rewrite and as i update my code change my mocks and all that so this is very neat okay now here's uh here's an interesting one and i saw also i think you commented on this one david but uh mark gravel writing about like are we getting near the end of reflection heavy c-sharp libraries um and talking about like you know can we get away from that um no okay on to the next one i what you tweeted david was that it's steeply baked into everything right there's a lot of reflection people don't even think is happening yeah we we had um we had a contributor to try to run asp.net core without reflection and like resource strings broke and i was just like what oh of course embedded resource in the assembly you have to load it at runtime there's a mode in the runtime where you get like constant strings and instead of um look strings but but it's not in an xbox or so we don't have it and it broke like all the castro so he had to hack away all those strings to make it work and that was like part zero yeah logging in this reflection is like it's everywhere yeah well all right maybe somebody i think that's the point is that there's not all reflection is the same so there's like people say with reflection and do you mean ref emit or do you mean reflecting over members in order to get information and then within that category there's even further sort of buckets of how wide you're asking hey what's what's around what can i look at what can i do with it and it might be true that some of those buckets are probably somewhat problematic for the types of scenarios that are outlined in this blog post and so coming up with patterns that allow people to remove uses of of that kind in order to then make a smoother future available for us with regards to things like aot and tree shaking or linking um or performance generally um through your cross gen or or full aot um it's all goodness but it's not as simple as simply saying ah all reflection bad because.net is like you know it's foul it's kind of saying it's like what is net if there's no reflection like it's kind of it's hard to really get your head around it's funny i i came from a meeting before this um about reflection and jason and blazer to save trimming sizes the source area that they'll be built for the next preview it it changes the the experience in such a way that is not not as pleasant as it is um to use reflection so there are these edges that i think will end up experiencing as people learn how to source generate things um that that typically happen um today um not via that route and i think we have to find some ground in in the middle to solve the problems yeah and it's not as though the idea of generating code as part of a build is new in.net people have been using il weaving since before day zero um or t4 um you know possibly i would i would hazard a guess that folks using t4 aren't doing it as part of their build as often as they're doing it as part of a invocation or gesture of some sort um but source generators is kind of in the middle of t4 style generation and il weaving like it's the step in between but as fowler pointed out it's it's part of your design time experience like you're adding code to the app while you're typing in the editor type of thing and so um that's new and that's something that we all have to get our heads around to to codify what those you know patterns should be to get the right dev experience it's not all just about the outcome it's not all just about let's trade off everything about the dev experience that we love about net to get smaller apps faster apps you know et cetera et cetera et cetera there are things we have to think about what's that i said in theory as well in theory and then there's there's aspects like security as well which is if you you know link all the code that you don't need out of your app or you embed dependencies into your app um guess who owns all the patching requirements for that app now well you know it's a self-contained app that has parts of the runtime in it and not other parts and we release a security release every month um you have to put that in yourself and redeploy your app it's not as simple as updating some runtime so there are trade-offs everywhere nothing is you know nick craver likes to say this all the time don't give me an absolute everything is a trade-off tell me why you made that trade-off and helped me understand that's totally fine but anyone who says oh just do this really hasn't thought through the variables uh facing the folks making the decision yeah like i'm personally excited to use a lot internally like actually source generation and you know we'll add like a string to an array to make headers perform better and things of that nature um but we're also of course looking at how we can the difference between t4 and roslin source generation is the ability to basically reflect over the code at compile time right and then you get all the advantages of trimming aot et cetera um i know that we have issues david that are looking at like you know roswell's generators for di and generally making this experience better in dot net six um i'm not sure how confident you are on landing all those what what are your feelings um i think i think there's some hard things to think about like if you want maximum performance you want less indirection di was born to give you a direction how do you fix that issue right like like it the issue is like today when you call i services or ad item you see as ad signaler you're basically opting in to a subset of types that you want to include into your like di graph and you basically need the the only thing that understands the entire graph is the app when it runs so you need something and that and that is composed of your app and every level that you use in your transit closure of dependencies so day it basically has to have to discover and compile a graph for your app running at runtime um if you look at vs20 i think 20 in the previous version we had this we had this thing called uh meth uh a different version of math that was compile time though because of perf right and the way it worked it was it would basically upgrade it would generate a graph of dependencies um that were used by vs on insta uninstall right and it would change if if you added add an extension you you you get a new graph um so so that's the kind of model you're you're thinking about with with di as it is today designed to make it work well so like today i can just like party on an i-service collection and do like whatever custom startup logic i want to control my services so in the future if i want to work without reflection we're going to have to come up with a new model um they'll probably still be nice to read from config and stuff to change your services but yeah it's interesting there's been a few folks who have attempted this already right there's a couple of libraries floating around i think and there's a couple of external ones i i'm not and we discussed a lot of this during 1-0 like this all came up and made a kind of a philosophical decision to go with code and say code is truth we will we will continue to optimize this over the coming years to figure out how to solve some of these problems but code is ultimately what is the lightest weight least ceremony easiest concept to understand that gives you the flexibility to do anything given enough time whereas inventing new layers of abstraction dsls new declaration patterns with tooling support like that's all big up front design type of thing and you have to try and solve all the problems up front and i'm using broad strokes here so forgive me um one thing i will say is that i'm not i'm not too convinced yet that solving some of these problems requires a completely new pattern it might be that we simply need to have some restrictions for example if you want to opt in to this hey can you aot my di container for me in this app there's only certain things that are supported when you do that and if the the compile finds code that's doing some other thing or it goes yeah no you can't do that because you're you've got an if statement here in your i service collection thing whatever it might be right and then we can chip away at the use cases where you really do want to be able to do that type of stuff but we need a different way for you to to declare that to the tool set so that we can detect it now there are some incredibly um clever code-based uh sort of inference systems out there like the monolinker does you know basically code analysis right like he figures out and does branching predict does all this type of stuff to figure out do i need this line of code or do i not need this line of code including like what api did you call in the if statement or what api did you call here oh i know you're complying for that target that doesn't work on that target i'll just link it out like that and again speaking broadly so there are things that we could potentially get to but they're all you know hard problems i mean we can solve in one release but i think there is a long-term vision and the longer you look out the hazier it gets it's harder to tell you what the solution is going to be but i think i've gotten to the place now where i'm convinced we will get there like we will get to a future at some point where you can take you know a net new you know console app.net new blazerapp.net new asp.net core app and you'll be able to natively compile that down to a single lexia that has the entire runtime in it and is minimal we will get there and works it's going to work and then when you add a random nuget package a popular one it will continue to work rather than breaking horribly because you added a package that does something you can't do we will get there it's just going to take a while well do we want to see my last link or do we want to we're really fine go ahead and show it one more okay i actually this is one of those cases where i put them in the wrong order apparently but i love this this this was one that was shared over to me too this is from the 18f team which is actually like a team of people that uh go in the u.s and and work for government for like a few years um and a lot of time it's some really cool like leaders and technology space that that go and do this so it's almost kind of like a volunteer thing but what i love about this post is they talk about choosing a web architecture and i was kind of like uh yeah this sounds boring actually i love this at this suppose i wish i'd written like so here's what they're recommending if you can make a static site like start if if you're if it's static content build a static html website if if you can't make static opt for a server rendered app like you know and then only and then like move to interactivity and even here like bring in interactivity you know at as you need it with javascript um and this is just something that's been frustrating me just kind of in general is that everyone jumps to react in angular and spa apps for like really simple things and i get questions from new developers who are trying to learn web dev and they're getting overwhelmed with like the complexities of bundling and you know injecting all their modules and all this stuff i'm like just learn html you know start with start with the basics you know and people just and and i feel like the whole industry is pushing people towards week one like do the hardest possible case so anyhow i just love this and i'm happy that someone else is thinking the same thing i i wish that we started with the simpler solutions first that's it for me we could talk about rows but i'm cognizant of the fact that we promise people we talk about yeah yeah minimal apis never rendered everything clients everything client side static files all right who's going to who's going to start this off minimal apis what are we doing minimal apis um so i'll start a little bit so first of all stefan is the main dev on this whole thing i am just here to support him um but and so this started i want to say two years ago i made a framework called feather http as a result of someone tweeting something that made me made me angry and it was basically a tweet about how every donut application ends up having like i don't know 50 files it's like five but 50 for effect right 50 files right and you compare it to the the goals the pythons the javascripts and we look complicated so for newcomers comparing samples side by side we have like four classes and app settings a props file json file cs frag all these things that aren't your code that that you do have to learn at some point but we put it in your face from from like day zero um so the idea with feather was how could we basically give you a minimal experience for getting started without destroying asp.net core and losing what we've built over the last five years so it was key to basically keep keep things that we built working we couldn't build a new off system um we couldn't rebuild components for both new and old days but of course it had to be the same system so i spent a bunch of time trying to figure out like what an api would look like and and maria who isn't here right now we actually spoke to i want to say 30 customers or so um who weren't who weren't deaf from our platform right um we basically asked them what did fob.net before and after so we had a tutorial um that was like a to do out with a react front end ha ha reacting to the front end um and i died backhand and it's funny i think i think one of the best quotes i heard was my dad use dot net as in like is this old thing that my dad uses but i use python um so i'm but but after after the interviews people's impressions were changed so we were hopeful we figured okay this could be a way to kind of bring people into the full that that wouldn't typically like um use on it um so we we spent the last i want to say like three months trying to figure out how to design an end-to-end experience for apis as a as step zero um so from the host to apis build an antenna experience that was simple simple to get started but then can grow into into bigger apps um i've been tweeting a lot of stuff like with small apps to make people understand that this thing is minimal there's a lot of like pushback from people who are accustomed to having more structure um and the the the intent is that this thing actually works well for bigger apps but it is optimized for for like the the small apps right um so let me screen share i'm stefan feel free to jump in and say words if i miss any words i'm damien sorry i just reconnected my headphones because i thought it was crackling um they work now do they sound okay good or just okay now all right i'm waiting to see your screen to share oh uh and there it is you see it all right so i can't see the the broadcast right now because my other screen is like unplugged but here's a simple application um the one that likes to be here last night that i built um last night as well it's a to-do app there's no front-end because i'm lazy it's only a back-end to focus on the actual apis and you'll see there are no usings we should freak you out um you know what i'm going to say zoom in that code oh yeah yeah hold on hold on hold on should i change the font size i'll just zoom in whatever yeah yep that's i mean yeah that's good so this file has no usings um there's a call to map get i pass in my route i have a lambda here i i'm doing typical credit right um get get all get my id um add one delete delete one so this is super simple um but what is actually happening under the covers like what is going on here i think everyone everyone calls it express.net which i think is hilarious because i guess if if if i go back to a time before express there's been other other frameworks that were there before express that had a similar feel sinatra um was there way before express on ruby um my guess is that flask on python so my guess is that like express copy those frameworks but no express is so prevalent in in the node.js space that express has become the de facto for any for anything that wants to do mapping a a route to a to a function right but to be frank like you see you look at all the web web forms so there there's kind of two two styles there's mapping a route to a function or having an uh an attribute on a on a class um that describes the road there's only those two styles and they're expressed in in different languages but they're kind of the main styles i've seen at least in in web frameworks i think f sharp has has more of a unique style out that i've seen in giraffe as well um but yeah so draft is really cool yeah yeah which is an f-sharp web framework okay so this application is is not doing too much magic but let's break it down so first of all i guess i should run right first to make sure it works i'm running preview bits of everything so if it seems low it's because it's pretty big so nothing on the root url i'll type in to do's you uh you can hide that thing down at the bottom where it says stop clearing your head so empty list right to do's mp make sense i'm gonna use postman to add a new entry there's no support for swagger so there's no swashbuckle as yet but bb5 we'll get there exactly we'll be there eventually yeah i mean let let's just remind folks what we're looking at is preview preview preview yeah this is stuff that's not even in the publicly yeah it's hard to how to phrase this now the official previews the last official preview is preview 3 you can grab a nightly of preview 4 or main which is preview 5 right now and then you can try stuff out um but this is like super early so if something isn't there it doesn't mean it's not coming and if we don't say it it doesn't mean we don't plan to do it the source of truth is on github that's where the discussions happen and if you want to want to ask something in the chat do so and we'll do our best to answer whether that's in scope for six or not well if you want to try it now you can compile the special brands from the rosin repo i think david might have an internal v6 though i'm not sure it's in it's in mainland so if if you were to build roslin's main branch now and you get a v6 you can install it into your vsn and make it crash a few things in the chat one is this looks also like nancy and i think that goes kind of two years and and you mentioned before like sinatra and is related to sinatra but it's that that style and definitely it's i mean like props to to nancy for like you know like being in this space for a long time in the dot net world right yeah so so we should say word about nasty nazi was kind of the the innovator here in in the about that space so not to nazi came i should probably type in that c c sharp plus i don't get some weird search results should be at the top i deserve it so so this is nasty and nazi was around for years like i i want to say like i don't know when it started well it itself was a was a effectively a clone or inspired by sinatra which was a very popular node.js framework right i can find the first commit oh yeah isn't there a site for this somewhere there is no longer being maintained now but it was basically the og like of this space in in.net right and and the idea was to get get rid of get around the craft of nbc and asp.net and i think it was one of the first self-hostable frameworks too that ran cross-platform so it ran on mono so it's cross-platform um and it didn't require it didn't require windows and iis to run and i think that was like a first in this space um so basically this is if if you if you i guess if you weigh my the clock this is inspiration from all those frameworks that were derived from nazi um in the dot net space and onward so kudos for inspiring us i i'm seeing check-ins back to 2011. yep and i i think it may have started before then but that's yeah yeah yep um so have a postman request here where i'm going to send um a json post to my to-do's endpoint just to add one and it told me something about https which i will super ignore and use http instead 2004-ish wow that is super early that's net to 2004 yeah i was i was in i was in secondary school [Laughter] and you're in your 30s now so that's you know it's not like i can call you a young person really it's legit so i did i added the um the the to do and that wait where's the oh it's name what why is it name that's wrong title it's bizarre let's do this better so decent response super simple i could delete the i could actually send a delete and delete that first one because okay we were off it's 2009. so you may have been at a second there you go don't know 35 timeline yep so erase that one it's gone so the rest api works it functions i can delete add and view my um to do's right very nice skip it one 404 like this thing is perfect now what's happening under the covers here is that so the intent was not to build a new framework so asp.net core already comes with with um um the app builder routing we didn't want to redesign all those things so if you look at what i can i get when i do app dot i get everything right map controllers map hubs i map blazer hub not fallback um but i also get used so use endpoint to use static files use cookies this this application is this uber type that kind of merges routes on the app builder into one one space um so if you if you recall how apps are typically composed today in asu.net um you have program cs that has a main it calls this method called create host builder with args it calls build and run to build the host builder um creates the default host with a bunch of defaults like logging configuration in a specific order and then we call configure web host defaults where we call you startup this is deemed ceremony imagine you want to add a single endpoint to see how asp.net core was working you have to kind of get through this right we should point out too that this is a lot of these apis were introduced in post 100 versions of asp.net core yeah the first there was no concept of defaults and we introduced a lot of that in two and three two two two point x and then three o uh with the default build with the host here instead of the web host so this has grown up over time but there's still a lot of ceremony here like line 19 that method like why does that exist there's nothing here that multi-white that exists um the fact you have to pass lambdas to things just to call hey startup please like and there's all good reasons for why it happens this way it happened this way but every now and then it's good to step back with new goals and think how can we build something that doesn't invalidate this but slots in somewhere um complementary to this right you you basically want to appreciate why it's there but i think we put it in your face without giving you a hint as to why it's there so you see you end up treating it as being required without thinking about why you need it in first place um like so this this thing for example like is here for a very specific reason and without it some things don't work but if you're building an app from scratch it's kind of hard to appreciate that stefan right and not everyone needs to do yeah migrations or whatever so um though we're looking at how to better support that with the new minimal host in your mind when do you think that there's a clear scenario when you should use one versus the other hosting models again i don't have clear clear guidance for any for anyone as yet i think we're still trying to feel it out um i think both things solve similar problems i i guess i guess the question will be like what will people do with these apis i think for for example i think i think this lesson lazy to use in a library if you're trying to embed a a little web server as part of your binary to communicate with an app this might feel like noise to you right whereas this approach might feel like okay this feels like i think i could embed and use without without hassle i would i would go as far like even now now which is fairly early i'd go as far as saying i think you would always start with the premise that you would use the less ceremony um we call it direct hosting that's the name that we coined for it um and and then only move to the other hosting api pattern which we call composable hosting um i call them that anyway we haven't officially put that in the docs yet but i like that um uh when you need the features of it so you know it's true that the the hosting api that was on the right this one it has more features you can do more stuff with it but they're quite advanced you can do like more than 80 of what you can do with this one with the with the newer direct hosting model this one though allows you to do things like use a single host that's hosting multiple app models like not only a web server but also a worker service for example i'm going to make you sad i mean you ready okay let's give [Laughter] yeah i i that's great dirty logic being aired so you configure a host you add the web host and so one change we made in asp.net core i believe it was three was we unified the worker service and the web projects to the generic host with the intent being that you have a one hosting model for for all app types um the host deals with like lifetime configuration di logging concerns and then you plug in a hosted service or a startup um to run your specific application domain so i call you startup here is our class for startup has more stuff in here like 50 namespaces um configuration injected you get configured services you add your services here for di um your configure is where you configure your your your your pipeline for um for asp.net core so you just use https the developer session page swagger endpoints author authorization endpoints and map controllers so this is your typical um it's micro application wire up by default when you did nothing um deal with this stuff which is super useful but can can be deemed too much um for very simple very simple cases so we got a question from glenn could you do something like app users pages and map razor pages and turn on razer pages you found the magic sauce so you want to think so let me contrast these two these two approaches so here's the controller here's mvc with your typical attributes that kind of map map to what we have in the in the let me put it side by side to this application right here so to do's well api to do's might have to like get get all and you inject into the constructor instead of into the method itself um actually this is this isn't using dll actually this is all just inline um so someone just asked if if you can actually wire up wizard pages using this model so this model is actually as powerful as the other model it just gives you a web centric focus so so it's your first entry point so this is the fast mode to like create an application and get started but but it's kind of a toy there's this create builder you can actually use is it fair to say if you just call create you basically just get an endpoint pipeline right you get you get middleware pre-configured with the ability to register endpoints which is the endpoint and the new minimal apis which are just endpoints basically yeah i will add that there are a lot of cases where you might use di with the old hosting model just to like flow things from program main to your actual endpoints where you don't need that anymore like if you define variables at the top of your program you can just use them in any of your endpoints so you don't need like complicated bi magic or some stuff now you want to use beware of object lifetime but yes exactly so so here is basically configure services okay speaking of configure services so peter says like configure and configure services are confusing for beginners those names damien's not i always felt stupid but i seriously like there's like a mental i stop for a second every time i'm like okay wait this one is you know yeah and and honestly we we went with the this like hollywood principle we will call you back kind of thing but you give us a class and we kind of invoke it via reflection it's kind of messy um and we've had it for for years and people have complained about it people we actually had an interface called ice startup that we that we deprecated because it was inadequate um i startup had you know configure and configure services but it's limiting um in what you can do so we kind of made it deprecated so my like super high level you know dumb guy app dev feel on this is nvc is is like powerful but was a good amount of ceremony so then we got razor pages which is kind of a layer on top of mvc it like runs on top conceptually at least of those base classes and if i ever need to dig down into something i could have done an mvc i can do it but i layer on the complexity it's like just in time complexity that's right and this feels like the same sort of thing where if i need to like customize middleware or startup or di or whatever i can but i don't start with that right and and so so watch this so here's my configuration from the application over here so there's today's application and here's what we have that's new i can actually grab this verbatim copy it here replace services with services your services and then for configure i'll copy this whole thing they don't have swagger included but let me comment though for now copy this oops where are you most has that let me comment this out and what's missing m so m's i actually exist here environment i don't have swagger so i can't turn this on but it's the same idea right and it all just works it's literally just works as is so you can see we basically convert we basically translated this model where we call you to configure and then and then we we we can get control back to kind of configure the application you're doing it here in place without these callbacks and that's kind of the the pattern change instead of instead of passing instead of calling configure services and adding a callback you just configure the services directly on this collection it's worth pointing out that a lot of the a lot of that ceremony and complexity with how um configure and startup works i think back to when we were designing all that and there were lots of other patterns that we supported and we kind of like you can do configure environment name and we'll just magically find it and it'll call it yeah and and there were other things of that nature and frankly i think we kind of left it all in created things with that flexibility and then we would waited to see what the community and customers would use the reality is i think we probably didn't consider or under-appreciated just how powerful what is in the docs and what is in the template um is in with regards to co-working um or creating idioms um and this is an issue we have with net in general because we ship a vertical stack with everything a tooling and templates and all the rest of it whereas if you start with node you don't get anything you get node.exe and then it's up to you to go off into the ecosystem and find well how should i structure my app um and so that's i think that's one of the reasons why it can look very daunting to a new user and even to an experienced user for certain types of apps i mean i've been working in dot net since the beginning so over 20 years nearly 20 years now some apps you look at and go why do i have to write so much code why do i need five files which i never gonna change which i never have changed the content of just to have an app that has three pages right and or oh you know one three api endpoints and a signal hub or something like there are there are literally hundreds of thousands of apps that exist like that out there in the world and that is the gap i think i was i was alluding to before where we think this can slot in but it's also not just for that it can grow up as well and there will definitely be cases where people go now i really need this functionality that mvc has and i'm willing to pay the complexity the performance cost etc etc for using that because i need it for this application that's the right trade-off but it doesn't mean it doesn't mean we weren't thinking about these things in the beginning we just made different trade-offs at the time because we just weren't sure right and and to be fairly the there's kind of we we always build features with layers so the host itself and the the lambdas are are our different features that can be used in and that can be used um in different parts of the stack so for example like here's here's that of me trying to use mvc with the new host right this works fine add controllers i add razer pages that all works right but they're not services what if i wanted a startup class with a minimal host you do this no i mean there there's no built-in support i mean i guess it would work but it's kind of kind of jank yeah i wouldn't encourage it but even that is there there is here's the so here's the magic this host basically tries to encapsulate i said before like all the features we we've had over the last five years built up by everyone so it it tries to preserve all the primitives so for example if you need to need to configure a different framework you get the i host builder given to you but it's not in your face um same for the web host so you can always get to the guts of these hosts to configure them the behind the scenes posts but the api is basically giving you um a facade over those apis so they're not in your face by default i want to point out also go back to the builder for a second that you returned was it that you were showing we were brutal in deciding like here what members are on this type like it would have been very easy in fact you know in a lot of iterations of this before what you're seeing now there were more members here yeah but they might need this oh but they might need that going back to the angle looking through the lens of a new dotnet user who might be an experienced python user or an experienced node user or maybe they're just a newbie completely everything we add here is a new concept that they potentially have to think about before they they they use or they might be using your statement completion based learning which we've all done we have yeah what do i call here the new web application dot and then i look at the things and i look for the logical name i remember back when i learned asp classic um you would learn about the five god objects right the five objects in asp classic either server request yeah session uh i can't remember the other ones but that was literally how you learned you learned the language like if loops and stuff and you learned the five objects and now you could write asp pages um and you would only learn about each object as you needed it depending on what you were doing in fact to write your first page you really only need to learn about like one or two um keeping that in mind is also something that we thought we're thinking about a lot i think when designing this entry point the the complexity or i should say the richness is all still there it's just not on that first object necessarily right it is we're thinking very carefully about that sort of layers of progression or the progressive disclosure as you call it in ux design of at what point do i need to introduce the user or expose the user to this concept on their learning journey or in the journey of writing a new app even if you're super experienced like why should i have to hit dot and see 40 members when 90 of the time i really only need access to these five right that's the type of thing now that's really difficult that's just like api design in general is ux design in general um but you know we're five versions in now and so and we've got a couple of new goals that we're trying to go after and so i i think we'll i hope that helps people understand where we're coming from right and this is kind of one half of the the apis i i do want to show the other the other parts as well um so there's an api in a class with a static method um same content as we had before but i want to show some some new features in the language and that we added to instagram network so ace.net has four at least uh i guess the third version has had maybe in 2.1 has had these map get map post map put map these aren't new methods um we've had these for a long time they've been shaped differently they've been shaped with this because the the new ones typically they look like this where you would get um to pass in a row as the first argument and then you could pass this in called request delegate all right and this guy gives you a tp request and that's where it got really hard and then you have to do like parse the request parse responses write response find apis all right super low level well the feature we added and are the features that we work with with this interrupt team to to make easier there's no new overlap that takes delicate just delegate right um what's up this is here so the request delegate is a delegate right right so right so regression delegate takes andy it should be called this returns task um delegate itself has no shape it is like the object for for delegate and the trick was to figure out how to have the compiler correctly give us a function without having to do the cast right so like so before in our initial versions of this you have to do like funk of task of list of oh my god i'm surprised how few people complained about that in our user study like i think they saw it and they're like eyes glazed over and they just like copy pasted it and just no one said anything that's crazy yeah so so then the new compiler feature is that i can do this no and c sharp will infer that this type is a funk of ant because it returns ant and and it can be assigned to a delegate this also works and you can use right all right but savard doesn't work in my build var is coming oh okay so then i can map to that yep expression works as well so we're finally blurring the lines between all these very related but slightly different terms in c sharp like functions methods delegates lambdas yep and like some of them are very like language geeky like you really have to understand the difference to to to to um to talk about them i actually started in vb.net and then i didn't learn about delegates until i moved to c sharp and so even to this day i'm like if someone asked me to explain the difference between a delegate and a function and a method and and or and a lambda i'm like yeah but like now yeah they're all kind of like i mean i know they're different and like i know with the c-sharp event handlers i had to declare delegates in the early days and i didn't in vb and like it was like ah but this is finally i think this is going to make it just look more natural it's more expensive right right another thing is i've been working with the uh fsharp team to try to make sure this experience works reasonably well there and i think i checked in one of the first maybe the first f-sharp sample project into our repo we have templates yeah but we don't actually use it like our sample so we want to see how well this will work with f sharp and we're designing for c sharp first like you know um people tend not to like the builder pattern right because you have to write ignore a lot uh but we're still doing that because that's the convention we have for map post method but it's certainly something where we're trying to make is as good as it can possibly be so so here's the old pattern context request response blah blah this this all still works just fine now we can actually do this right i can just say now question does this lambda opter operators do you find from talking to people are those are those intuitive to like the more beginner lightweight feel dude the arrow functions you mean so this drives me crazy so like what what kills me is like node is like the beginner language now right no not in python those things are all lambdas they're like literally all lambda functions everywhere and known i mean they're declared with functions so maybe that's the difference well they're not now like es5 and beyond right like it was a move to arrow function but this is a really good point that i wanted i was waiting for the right point to make too the other thing that we that we're empowering ourselves to do this time around is utilize the language features as we design this api and sort of this application model like the invocation patterns and the patterns that you'll see in the code so c-sharp has like changed a lot since version six yeah um guys i feel like they're still built around like the two o yes and there's a good reason and i'll and i'll be very frank in the beginning when we were designing asp.net core and we were doing code reviews of this with management like very high vps there were concerns that oh this is too complicated if you have too many lambdas like net developers don't use these things yet and so we we we erred on the side of maintaining the same pattern use uh where in a lot of the places right you have a class for everything and we did have nested lambdas which is you know unfortunate because that is a little a lot of indentation to get around um but since then c-sharp has gotten great pattern matching and it's gotten well we're adding features now in c sharp to make this stuff uh even better got top level statements we're getting global using so we want to utilize those things as we develop this to fit into that slot that we've already kind of talked about so i think it makes for an incredible we're not stopping here we will go further as the language develops over over future versions um i think this is not the end this is the beginning and i'm really excited about where you know we'll take c sharp and the rest of the dotnet ecosystem and learn from others like f sharp as well about what's possible uh when doing this type of stuff one other thing sorry just one other question on this going back to the like i'm my brain was formed more around the like you know early c-sharp style when i see this i start thinking of like well especially the one you were showing earlier like it can feel like a script even though i know it's not but it feels like a script and i wonder then about like am i going to build spaghetti like because one well there's a lot of ceremony in the more you know structured approach it is more structured right and so this feels a little bit more like so but it's not right i mean it's all it's all compiled code and i can abstract things to other functions if i want to and that's the key so i think the goal here is to remember that we're leaving it up to the developer to decide how they want to use language features and type features to organize the app for the benefit that makes sense for them as opposed to developing a framework that says you must use types you must put you know a class in a file if you don't do that the tooling doesn't work properly where we're leveraging the language features and a very minimal upfront api which then allows the developer full expressiveness to decide how they do their um their code structuring now that's not to say that we we still have to kind of deal with the whatever we put the templates in the docs is what most folks will do we still have to think about that but that's something that we're also really cognizant of here is that if we use a base type everything then looks like c sharp did in 2001 because you know it's really difficult to to change that you're forced into all those idioms that have been around for a couple of decades and i would say that you like this doesn't stop you from having a very like consistent organizational structure in your code like this just gives you the flexibility and to your point john i know that there's a risk especially for new developers who might you know be attracted to this for the easy startup that they could code themselves into spaghetti and you know as i think good docs um and good templates and things like that will help there but um and the other thing to know is like we're the old structure isn't going away i think people should call spaghetti like just coat spaghetti and then you'll learn eventually i think when you when you give people too much structure up front they don't appreciate why it's there in the first place so like so it gets it gets spoken about as as being complexity and unceremonious for for for good reasons right like you have to earn the you basically have to kind of go through those phases and you're kind of like your career to kind of understand why you you want test why you want injection like i'm i'm i'm trying to create a a new context per request here like i can't test this it's buried instead of a static function somewhere i can't test this besides um besides having to use a a tool like curl or postman that's fine and then i could learn you know why i want di and then i can kind of migrate to this pattern where i inject my my db context and now i can test this thing right but i can't because it's still buried in a in a function here and then i can learn about functions and then grow up from there and say okay i want to declare functions i have to learn about return types right and task of list of to do of what the hell ever i can do this right this all works just fine now and then i can grow even further and be like oh you know what i want to use classes and mvc and attributes and i understand the magic and discovery and i kind of prefer this model i i think we just are gonna are gonna give people less structure so they can choose um and i think apps have to kind of grow up into this pattern you don't have to have this by default it has to be a choice and i think other platforms have proven that that's the case right yeah that's a great point and one of the pieces of feedback we've gotten a lot about this is like how do i test it right because a lot of the initial template and stuff isn't super easily testable unless you want to go like full end to end but like take a look at david's skin example like before the full controller like that's testable um so you have options there um basically the answer is the same way you would test any other c sharp or net code which is you factor it in a way that makes it testable right and with the framework doesn't force you into a factoring that is untestable like you know system.web happened to and we had to kind of break that mold with system with system web mvc but there's only so far we could go and then we did it more in web api etc etc and now we've kind of come full circle which is well if we just make the primitives based off the most basic language constructs then it's up to the developer how they structure it in order to be testable we still honor the like we don't use statics for state we don't all those type of things that make testing hard that's still true you get to decide how to factor it and as long as you can call it like a method or a delegate or a lambda as long as you can point to it it'll work so one thing i i want to kind of explore is could i control dot extract local function and then control dot and extract static function so you can kind of like when you want to test you basically need to expose these types to other codes that that can be called right so like if if you look at the progression from lambda to local function to controller or there's kind of a stage four which is like move these functions to be class level up here and now someone else can call get to do's that isn't the route function itself right so now i can actually pass in all the state required the db context and test this function without having to do any weirdness so okay a few questions coming in um so shane's asking is this just about style and ease of use or are there additional benefits and like to to go along with this have been several people asking if this has performance impacts yeah it's actually much much faster than nbc but it but it's faster because you aren't paying for the ceremony and it isn't because we showed the dashboard we haven't yeah i mean he's one of the motivators there are multiple motivators multiple goals for this effort and one of them is performance fowler spent time looking at mvc and making changes to mvc to make it faster but you get to a point where you as framework developers we were having to make trade-offs which were really painful it's like how can i make this mvc scenario faster without fundamentally breaking nvc and we were having to put like short circuits in and top level options and like if you wanted the fast mode you'd have to opt into it but that would break existing code unless they went turned off this other thing like we were in that situation because nbc has a legacy which is a benefit of its own because it makes it easier to bring code forward and make it hard for us to evolve it so yes performance is part of the motivation and i guess we're about to see the the prince stephan is it is it on the nbc benchmarks or is it on the main picture in benchmarks uh it's still called map action so you search for map action and we haven't shown these as much lately but like this is part of how the team develops yeah i mean this tekken power sort of derived how it all started but now obviously we use uh this is our own copy of it yeah we this is still something we do every release and we still drive down every release so nbc for plaintext is this 2 million rps and then my action is 3.4 can we compare jason which is probably a little more real world yes we can it looks like we don't have recent numbers we had issues with some of the recent changes there i think yeah and it we think we can get this to be faster as well wow um it should approach middleware basically where's middleware is that here somewhere yeah there's a filter json platform is uh super fake people all right so we think we can get super hot production super close super close to um this one i mean and just so folks kind of understand the reasoning here ultimately this you know i didn't want to call it a framework but like this this new approach is just doing less right like there's less going on that's implied like yes the json serialization is implied so that's happening and you didn't set any configurations or anything it just did it and obviously there's a little bit of binding of sorts going on because you have parameters and those have to be discovered and populated in some case uh but not in that case and that's kind of it right other than that it's endpoints like it's just routing and endpoints which we had in dot net five and even the one three and three right so like and that was already just a little bit slower than pure middleware because you were just adding the routing layer which was very low overhead and now we're just adding a little bit more as opposed to mvc which supports everything in the kitchen sink and then you have to turn all this stuff off that you're not using to try and get it faster but there's just so far you can go right which means and so the the initial um version of this we we called it map action because we basically were taking nbc's action concept and saying you can use actions anywhere in sp network which means you get model binding like this you get binding for services binding from from route parameters and even this right i can do authorize here and that works and you still haven't dealt with the new language feature related to that does that work in your build it does uh actually so this works as well i know i can actually do everyone's gonna barf because it looks kind of gross but where's my first api to do api let's say i don't want anyone to hit the home page i can just do this okay i do kind of want the attributes up there right like above the call to map that happen i know but we also support the endpoint metadata approach as well right yeah crap i can do that this makes it off super hard it's like two levels of security checks beforehand right [Laughter] yeah we did have questions yeah so i was answering a question i may have missed it we did have some questions on what are the security impacts and stuff like that nothing all works nothing is different literally everything you then you know in experience core works as they work today and again that's because it's based on endpoints and the all the work that we did to enable endpoints in three which involved creating the authorization middleware creating the new attributes that we're in you know not dependent on nvc all that stuff is being used here it's the exact same stuff where do i throw those author like say i want to authorize just the to-do's you know what i mean like where come on right i just put attributes right into the into that you can put it there or you can call the method after which is the same thing you can do in any endpoint route today you can say blah and that adds metadata to the endpoint declaration and then the authorization middleware is already in this pipeline by default like it's in the webapplication.create right you didn't have to add it we just did it for you okay so you can still try and jonathan's been patiently asking when can he get this new c sharp i wish i knew okay i think it got merged to main today so it might start appearing in preview five bill soon as for my vs version like this is some hackery that i have so i'm not sure when we'll have it public in vs but my guess is by preview five we'll have something that is available for everyone to use publicly i see you're streaming the internal preview i think that's like off limits for build but apparently community stand up last year it's the only one that i haven't saw actually i don't have the problem at all um so no one would have known if stefan had they called yeah who knows right so now i'm getting david in trouble you're welcome not me um here's another um c sharp feature that's being added in c sharp 10 global usings and globally yeah using in general so this i love doing this because this is just noise to do right mm-hmm um this is asp.net core it's not where we did spend a lot of time trying to make the apis trying to make the nations um be less granular so you end up with this in pretty much every file where you use logging di configuration et cetera so like what's this file it's a global using oh any file that you have actually it could be any file that has imports um it's just globally using okay yep and that's project wide right what's that yeah project wide and it cleaned up a ton of my link actually it feels super weird having this touch the top so i just put a space there uh there's a question about the eye result return type did you cover oh no that is my question yeah so sure yeah um basically this is an action result without the um action invoker some action contact action contact there we go um so it's just an hd context uh if you look at it david has it up so this is how we're going to enable um returning kind of custom objects so if you implement i result you control writing the response basically in execute async that's the expectation of course you can do anything you want with hp context but so if you want to have like a xml object you know or an xml result type that takes an object and serializes xml that that's going to be an option so we've taken the existing like chain results and some of the other result types already that are in mvc uh and we now implement both i actually i result and we have some work to basically do that status code results another one is also with eye result um so the idea is to do that for every single result type um that we possibly can right so so jason result no implements action result i i result is good action result which is pretty funny right but for to work with the new minimal actions you just have to put high result this is so people can use existing types wherever they want yep i i actually did one trick here that that no one complained about so i was gonna call you out david where was that for that function that's that's not real oh good where does okay come from these are magic these actually aren't in any build yet um they're my projects so i used a global using so i did this here that it imports global using static results now i have this okay function from like every every um single file by default which is kind of crazy where's my function results and not phone just does a 404 um okay this does 200 stats says this okay this json result this is my like result types for nbc so it gives you that mvc feel about this yep we do but it's not in yet uh there's a question on static static classes with static functions i think some of those were examples you were showing but your your main ones yeah yeah so what's the reason for that versus just talking questions choices it's just code right like we're not we're not requiring you to have a type or derive from a type or implement an interface we're not requiring you to have a static or instance so you just need to be able to point this to the method that matches the route and then it's up to you to decide how you want to factor that code right so the primitive is there's actually a a lower level thing in the framework um request i'll get factory dot create a create consent delegate if you pass any function in here it will give you a magic exhaust thing that can that can handle requests um remember that request delegate type we're talking about yeah yeah that's what returns um and this is what we use internally for all like the map git and map post um yeah and we decided that if we didn't do this people are gonna find a way anyway um so you can use this in any middleware um and it just does the conversion um so it won't work though yeah but anyway right so so for example i just passed in an arbitrary lambda and it's going to convert this into into a thing that writes the response right hello hello world to the response like that is super cool and then all the all the inference all the defaults that are implied with that like the fact that a string is turned into a response or you're serialized is that all configurable oh yeah so that is one thing that we're talking about figuring out how to configure like these the behaviors basically um because one one tricky thing about this whole model is that if we add a change of behaviors is probably a breaking change um so probably need some some kind of some way to control like the inference behavior that that you get but that's not new right like if you change conventions and then you see the actions that's pretty breaking as well but yeah there are options right like we could literally add it off but that's something that still needs design do you want to show really quickly how you could uh call that inside of like a dot use or something i don't know you could just tell directly to get for example i could do let me delete all this code because why not this is going to be confusing yeah notice the problem here we're we're thinking about this oh god now whatever i'll just let's call run easier this is weird isn't it this word run around yeah we might we might rename app.run the one that doesn't take arguments just because of this um so that's something we're still considering i need to make it less confusing for the for the community's kind of people this is a function that takes in a context is it context nice i think it's context next it's gonna be wrong around this hey what what's complaining about is this brennan's shame i was gonna ask his brother i think it's brandon's oh yeah horrible what a breaking change okay ignore this name yeah how to use overload that tastes delicate and this this actually takes my hello world um creates a pre-compiled lambda that handles a request and then writes the response that message is json so if i run this it should just should work in theory all right so we're gonna we're getting close to the end of our time we have another show starting in 10 minutes so sorry i'm just uh so let's um we've had several people including people that have like shown up later and stuff what's the time frames what's the overall like when can we and and i know some of this is repetitive but when can you um when can people start playing with it and when will it ship right now so like it'll ship in net six so in november this year and you can start playing with it right now if you are super eager you can grab like daily builds or you can wait for the next next preview on that the compiler features are the hardest to acquire right now but that should rapidly come easier yeah so folks need to i mean there's a bit of a full stack effort going on here some of these things that fal are showing require literal changes to the language and so the compiler itself gets you know inserted into different tool chains like whether it's the.net cli or visual studio or vs for mac uh or even like omnishop and those type of things so if they don't line up your editor may say that it doesn't work but you can compile the compiler exactly right so when will it show up as a user where i can just like install a preview and things will create where um which we haven't released preview for yet right so that's two previews away we're roughly monthly so like you know do the math um but dotnet six you know we'll ship at the end of the year just like we've been saying for a while now this is the first time i've tried this is incredible i've never even seen this work before oh god no it is cool i think the request delegate factory is going to get a lot of use i'm excited to see what people do with it this is giving you the faster like action request delegate right like this is the sauce and yeah so we're thinking about our like breaking change compat strategy option strategy all that related to this but this is probably one of the apis i'm most excited about it's there you can use this to just like handle requests like nbc is there something you can show like on the repo are there code samples or or things with this that that people should see there are but not with the new compiler features yet because yeah we have we like it's not in our pipeline yet the new compiler okay so i will point to the build of um preview 5 that i use on the repo i haven't done that yet but um i have i built a repo i put it on the githubs and it has like the the code that's in here the imports um look at that github is like what's this little crap you have here um okay so to do apis different versions it's on github you can't run it but you can look at it and it has this note [Music] a couple of folks asked about the v word what's the word in liberation validation [Laughter] now right but we're considering it and yeah we have some cool things like this you came up with damien that uses the destructuring that i want to want to try out yeah so again like as stefan just pointed out there we're taking the same approach it's like well you could just write some code um but obviously there's lots of stuff that exists today but we wanted to if we do add something like we should be leveraging the latest language features to make it you know super expressive and super you know minimal so and not have a big pipeline behind it that adds all this in direction that ultimately slows everything down again um even if it's super flexible um the thing we need to be careful careful about is anything we add to the signature like he's being done right here um ends up meaning that that's more indirection more scanning more implicit stuff that has to happen um when this method is invoked and which which again is more in direction it it just adds cost to the indirection that is already there um so we've got a couple different ideas that we're exploring yeah but it may not land in six right we may not get to validation in six we'll just see i will say what code gen there is um definitely reduces the indirection after like start time um compare yeah but there's still some and there's still a cost for sure at least mentally i mean we didn't mention it but the way this works today is like we take your delegate we find the method is pointing to and we generate a ton of code at runtime once i start a super optimized function that that can be called on per request so there's no allocation besides the ones you ask for you allocate one one delegate and that's the whole thing and that invocation code you're talking about is literally the request delegate return by request delegate factory uh so you can use it you know wherever you want and i encourage people like once they get it to try to use it you know try your own microphone right like i think it will be cool to see what the community comes up with there's no generation for jason in dot net six two right there so we can get there so like we're getting closer to if not if not maybe we're already there to the point where a hello world json api is literally no allocations once the connection is i don't know no i mean so you still need to serialize the thing needs to be created for the civilization yeah yeah okay yep but that process this gets faster it's not pulled no i mean it's your poco so you can you can if you want to you're all poker of course yeah that's fine like yeah like this enough all the plumbing and everything else involved like if the only allocations are yours that's the most ideal case there was none by the framework once the connection is stood up exactly and like the cool thing about not having a class is you don't have to instantiate something per request to inject stuff use call function right um if you think about it the constructor is basically a function that is special right it it comes with baggage exactly yeah an allocation versus like middleware right it's the same sort of overhead as middleware where you just have to allocate a dell and it's the reason why middleware classes look a little weird because we have that that other method the two-stage kind of thing and it's because of allocation it's all about optimization so look at the request delegate factory create overload that you suggested david you can allocate an object you know that would be your class effectively every single request but that's certainly not the default um when you use like map kit or mouse but like that flexibility is already there um so yep david we're out of time we got we have another show that's gotta uh start just in a few minutes we've got a visual studio toolbox i believe talking about grpc which is awesome so the one last question uh where's the best place for people to like comment you know like keep up to date with this is there like an issue tracking this or is it just like um i haven't followed one see us with a ton of work do you have actually i might be able to post it in this chat um and then you will let's see all right john can you put this in the right place maybe if i can copy paste yep you put it i'm still using uh dan's old lap right here for this particular thing it's going a little slow like i'm seeing the beach ball so that's not a good sign oh my goodness um i should probably stop sharing my screen like i don't know why i was since the entire thing um can someone help me it's a recently filed issue which uh repo asp.net core um it's an epic it's uh minimal actions and hosting you sent something about that this morning to us all right uh yeah well we found it oh damn it okay i will copy and paste that we're down to the second all right so i will share this out in the comments and then we'll drop off and please stay around for visual studios toolbox starting next thank you to everybody this was great fun and thanks for watching [Music] you
Info
Channel: dotNET
Views: 15,087
Rating: 4.9347825 out of 5
Keywords:
Id: enAskgcF0c0
Channel Id: undefined
Length: 90min 28sec (5428 seconds)
Published: Tue May 04 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.