C# with CSharpFritz - Ep 12: Get Started with Entity Framework Core

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] there we go good morning good afternoon good evening whenever time it might be where you are out there welcome back to the live stream my name is jeff fritz and today today is november 23rd 2020. this is session 12 of c sharp with c sharp fritz check it out it's all sunny outside it's it's the week before it's the week of american thanksgiving here in the states and uh things are looking good things we're doing well here this is this is going to be the last episode in this season of c sharp with c sharp fritz we're going to move into another topic starting next week today we're going to talk about getting getting getting data from a database interacting with the database using entity framework core next week we're going to start into asp.net core as voted on by you out there the folks that have been watching participating we had a poll that was set up on our github and folks voted on the various topics that they wanted to see us work on next we're going to work on asp.net core starting next week right here going through all the basics from basics to advanced we're going to talk about building websites with asp.net core enough about next week today we're talking about working with the database using entity framework core to tap in and do those standard crud operations right crud create read update and delete that's what we're going to be doing today i've got some sample code written for us i've got i've got a readme that i've built that depending on where we go i'll i'll finish writing a little bit later today and we'll attach that to this episode and of course if you're watching the youtube recording you can find links to everything just below in the description if you're over there watching us on twitch if you're watching live the github link is right here coming into chat there you go so you can go through and you can you can see all of the jupiter notebooks that we've built to introduce c-sharp and some of the source code that we've written with visual studio code and c-sharp right at the command line to introduce some of the topics that we've been working with how we doing there chat room let me say hello to the chat room there they are over there so good to see you shai sharp is here jonas rc86 hello hello to you spektari hello you have three streams going and spotify that's impressive that's that's a whole lot of attention you got going on there kudos to you captain ted hello crabbos uh too hello to you taco102 horner how's it going good to see you whitlock is here landlubber oh my goodness thank you so much friends for dropping in for stopping by and tuning in live right there um and of course if you want to tune in live if you want to participate have your questions answered as we're going along tune in every monday it's morning for me here in the states 9 a.m eastern time 6 a.m pacific 1400 utc while we're here in in the winter hours right the uh we're not on daylight savings time when we get on to daylight savings time it's a it turns into 1300 utc and all the weirdness that happens with time zones and things at that point so um yeah that's what's going on there come on camera what are you doing not focusing here let's go get with the program let me head over to to the code let me show you where we are what we're going to be working on and get some music playing get all that stuff going on here let me head over there here we go and we'll get some right here's where is it it's right there there it is there's our github repository that we've been working in um you can head out there you just saw the link in chat if you're watching the the video like i said it's just down below it's linked you can head out here it's github.com c sharp fritz slash c sharp with c sharp frets all of our jupiter notebooks are in here there's source code for all the samples that we've been building and this is this is where we're collaborating this is where we're tinkering and learning together about all of these topics this is a very beginner friendly discussion focused session this is not the reference material for folks to go through this is really more of that discussion and hopefully there's some clips that that you'll find useful from what we what we're doing here if you want to create clips on twitch share those that isolate and show some of the things that we're going to be talking about today we're also going to have links in in the video below to all the questions that are asked along the way throughout the session you're welcome to head out to this repository uh create an issue if there's a topic you want you want to make sure that i cover you can see the planned schedule of sessions i don't i don't have the next um the asp.net core sessions defined yet but you could see i don't have any more sessions left in my october november sessions this is it entity framework this is the last one um but the next set of sessions that we're going to be delivering you'll find here in the future sessions there's ideas different topics that we're going to cover and i'm gonna start to dial in here um the asp.net core topics so you'll see those appearing in and uh getting scheduled lining up and under planning and as we complete them they're gonna move into the done column here so i have a blog post i need to put on the um the dotnet blog about this video series and telling people all the cool stuff that we've done let them know that hey we're over here broadcasting this is something you can tune in and learn um and hopefully have a good interaction along the way so asp net core just barely won the vote for user interface framework so we we've had this poll out here since august hey what did you want to see us uh move into next so wpf at 27 votes windows forms only two xamarin with 28 asp.net core with 59 votes blazer with 58. oh look at that somebody just dropped a heart on there uwp avalonia not making the cut so we're going to do asp net core next um a.net 5 migration um that's being covered very well by some of the other shows that are on uh that are on the channel really this is focused on getting beginners up to speed and getting them into um into the technology preferably coming in from a green field coming into a green field project brand new project starting something new not looking at migrating from one project version to another let me get some music playing in the background here this is stream beats by harris heller this is um royalty free music that you can listen to you can play on your streams you can play on your youtube um and this is his stream beats edm playlist i wanted to have something a little bit a little bit more upbeat this time and we'll just have that lingering in the background for um for us to hear when when the action pauses along the way here so thank you so much harris we appreciate you making this music available copyright free available for anybody to use stream restream listen to whenever you'd like i'm picking it up from my spotify subscription so that we can we can listen and have a good time here writing code all right so like i said a little bit more peppy a little bit more upbeat and i hope you uh hope you enjoy it in the background like i am all right um so today we're going to talk about database we're going to talk about entity framework core like i said it's the last topic we're we're going to cover in this um in this series uh in this season so let's let's get in i'm going to change i have a session 12 branch here that we'll put some edits in we'll update a little bit along the way but you'll see here in my sessions folder this is all the source code for session 10 of season 1 unit test session uh season 1 session 11 c sharp 9. we talked about c sharp 9 updates last week and today ef core and there's a readme here this is where i'm i'm going to be starting from and depending on where the questions lead us today i'll fill out more of the readme and maybe i delete some maybe i move some around don't know but we'll see an update appropriately so let's get into this let's talk about working with database i'm going to be using visual studio code today because because why not um the visual studio code is one of the most popular if not the most popular um code editor right now and a lot of people use it i wanted to get right to brass tacks i don't want to show some of the things that full visual studio 2019 puts into the mix that'll make things easier only because i think it's more valuable for a beginner to see how the sausage is made effectively right see the the bare minimum how things go together and and what makes this this happen so um i now there's a bunch of different database providers that you can use and they're going to vary based on what database vendor you're working on working with why why did that come through we shouldn't have heard that at all i that was a subscription over on my channel that shouldn't isn't even on this scene i don't know where it came from yeah that's not even on aliens right um so there are all kinds of vendors all kinds of database providers that you may use with your application and we're focusing on relational databases as part of this session there are ways to interact and and work with nosql databases like cosmos db mongodb um what have you there's there's couch there's a bunch of them out there that you can choose and work with um but in order to make sure that this sample is portable and that you don't need to have a database installed like mysql postgres oracle db2 microsoft sql server we're going to we're going to stick with the free open source database called sqlite that runs inside of a little file and it drops a file on disk and it ends up being very portable you can take that and run on any platform windows mac or linux even the mobile platforms you'll be able to interact and work with sql lite databases so we want to make sure that this sample is portable and gets across some of those concepts of working with a relational database so um let's let's talk about what nd framework is what it delivers to you and how to get our project configured for it so entity framework core is first and foremost an object relational mapper an o-r-m now as an orm that means that you take your objects your c-sharp classes here's like this class blog post turn it into relational data right you map it from this object to relational data to a record in a database and there's a number of ways that you can do that but the orm tool automatically will map one instance of this class into one record in the database there's other configurations and tweaks that you can do to separate out and create additional records and different database tables that's a little bit more advanced topic i want to get through talking about doing the simple crud interactions and working with different relations [Music] the primary and foreign key relationships today i want to focus on those basics within the day framework core so um if i've got a console application like this one sample entity framework was the name of this console application i just did a net new console application and um it created a net 5 console application i'm going to be using.net 5 going forward and i added in three package references right i need to instruct and tell my project hey you're going to use these libraries these facilities in order to interact with the database so i added microsoft entity framework core microsoft entity framework core sqlite and microsoft entity framework core tools these give me all the tools references and access to the provider that i need in order to interact with the entity framework libraries and eventually my sqlite database now there are shortcuts to not having to install all of these if you're using asp.net core if you're using some other frameworks uh some other templates these are already included for you they're they're provided and you don't have to go and add additional content i've added some documentation into the readme about how to add these packages into your project it's quite simple you would execute the command.net add package microsoft entity framework core execute that and it creates this package reference appropriately inside your project you can either create it this way and it'll go out to the nuget repository the public dotnet package repository get that package make sure it's the the correct version the latest version is on disk and it drops this entry inside of your project with version the appropriate version number listed so i don't have to think about the version number here if i just say net add package it goes finds it for me and adds it to the project so that's not too hard to do to go and add those references and make them available um and you'll see the last one here adding these tools adds in some analyzers add some content um so that it will suggest different features different ways that you can work with entity framework and get more out of out of your database library so really easy to set up and like i said it comes out of the box with an asp.net core project we'll see more about that in the next season but if you're adding this into a console application into a windows forms application a wpf application xamarin application you're going to need to add these by hand now once you have these the packages the libraries for entity framework installed the next step is to provide a way for this class to to have a portal to have a gateway into the database how do we get from source code to database now back in the day you'd have to create some sort of a class some sort of a helper class and we we got into this mindset of the repository pattern you'd build some sort of a database repository that there was a shim that lived in front of all of the arcane database commands that you would send over to create tables interact with those tables um but and i say arcane only because it's not c sharp it's you you have to know those things you have to know your database technology in order to interact and use them properly now because we're using the entity framework object relational mapper we now have something called a db context database context class that you can use to interact with all of those tables easily without having to write any sql statements and it just manages this for you so um i see a question there in the chat room let me finish talking about this topic and um i'll come back to that question in just a minute yeah good um so if you're going to create this database context so that you can interact and and have some reference to what these blog posts are that you're going to store um we can do that by just creating a new file i'll call mine app db context and uh let's create a namespace here sure and uh my namespace is going to be sample edit a framework um i'm going to create a class app db context because it's for my application and it's a database context i want folks who consume this class to know they're working with a database context i'm going to inherit from the db context object and i get a red underline that says i don't know what this is if i control dot this works in all of the visual studios it suggests to me oh do you mean entity framework core yes i do and it generates a using statement for me so now i i have right this is this is the frame of the portal that i'm going to use to connect c sharp to my sql lite database let me pause for a second i see some question uh in the chat room um let me bring these up so nothing else matters has the first question here if this was an existing.net core 3.1 project is there an easy way to upgrade all of the packages um if there is a try upgrade tool that's available i don't think it will actually do the upgrade for you um what i've done for other dot net core 3.1 projects that i want to upgrade to net5 i've just gone into the cs proj and everywhere i see 3 dot something i've replaced it with 5.0.0 and it's they've all worked properly another way to do it would be to go into the nuget package manager inside of visual studio 2019 click the updates available tab and it will show you all the packages that have the 5.0 update available you can select all update and it will go and install all of the updates for you so the important thing that you are going to need to make sure you do whether it's in visual studio 2019 there's a drop down box that says target framework and it would say uh dot net core three one to convert it to net five just change it to net five and it it updates this statement so if you're in text editor or some other uh tool you can update that line to net five and it'll now build for net five so it's not difficult to do but um the the tooling is there to force it to update you're then going to need to go through and do any debugging necessary to make sure that your code is still compatible with net 5. in my experience updates from net netcore312.net5 have been seamless not a single problem so um okay next question here is from um [Music] is this uh let humberg or is it lafumberg i think it's let humber um will i show many to many relationship uh let me take a i'll take a note on that and we can we can get into that um see i didn't even i wanted to make sure i i went in the direction that we needed here uh relational data relationships let's show many to many if we get there um [Music] try and i'll i'll try and get that into the mix so um what extensions am i using in visual studio code for c-sharp so i have the default c-sharp extension installed um i have the.net core test explorer i have there c sharp um i can chat with slack here code spell checking code tour is installed but we're not using code tour docker docs authoring all kinds of docs docs docs stock stocks editor config that's a good one to have because it'll apply the configuration the the preferred editor configuration for you um github pull requests jupyter notebooks live share [Music] so i think there's a sql server um to do plus yeah not a fan of yaml so um omnisharp comes along for the ride with c with the c-sharp extension you can see omnisharp is running right here um sharp has a question here [Music] if you use a mvvm pattern that's the model view view model pattern the blog post should be in the folder models but where should the appdb context also in the folder models that's where i've typically placed it for the purposes of making sure that all of these things are visible in this sample i'm going to have all of my classes just at the top level of the project when when you're using um some of these architecture patterns there are prescribed folders that you put things in to keep them organized and nice and neat you don't necessarily have to use the folders but it does make organization and locating various components a bit easier to do but i would put it either in a models folder or a data folder i prefer models though uh you have visual studio in windows but you don't like the visual studio code and linux to each their own that's right and that's that's part of what makes dot-net and c-sharp development now such a joy for so many people is you can use the tools that you prefer you prefer visual studio 2019 in windows terrific i know there's lots of folks that prefer visual studio code on mac that's okay too they've got the tools and support and they have the same first class experience that folks in visual studio have visual studio has some additional tools that come along for the ride for profiling running tests a bunch of other things but it's up to you you can use what makes you happy you've never used jupiter before is it worth looking into them i think so i think jupiter notebooks are a nice way to document and provide some running code along the way you can check out the jupiter notebooks for this series by clicking the launch binder link inside the github repository and let me share that github link again navigate there scroll down right at the top of the readme there's a launch binder link and you'll be able to launch a binder that's a service that runs out there that hosts jupiter notebooks it'll launch and you'll see i think it's 10 jupiter notebooks that we wrote that will show you a bunch of c sharp features that you can walk through and try out right there live in your browser whether you're running windows mac linux your favorite tablet your favorite phone you can run code right there c sharp code right in the browser [Music] [Music] um thanks so much all right so binder's one one thing there's also um we can also install and run code inside of a container that that visual studio code runs and i forget it's called code server code repository code remoting i forget what the feature is called we're going to be using that heavily as we get into the asp.net core session because we're going to want to get those [Music] those web applications running in a standard way standard location you'll see that when we get there next time so i have my application db context like i said this is the frame this is the portal that's going to connect our code over to our database in fact let's even can i split this um can i say split down oh there it is good so right i have a blog post that um there we go that we want to store in the database the way for me to tell the database to tell this this portal to my database that we're going to be storing blog posts is to create a property of type db set that and it's a db set of type blog post that will provide that gateway and check it out let me show you i'm gonna use my property snippet here so i'm gonna store a db set of type blog post right remember learning generics and i'll call this posts done that's all i need in order to give me a way to create a database context and now interact with my posts the the db set is an i innumerable it's a collection it's actually more like an eye list it's more it's kind of like a list because i can add items to that collection of posts i can remove items from that collection of posts i can select and filter and sort just like you would inside the database against that db set type okay so i've got i've got this set up so that gets me just about there almost to being able to write the database i need to tell entity framework for how to write to the database how to interact with the database where is it located right you've seen this probably in other frameworks there's a connection string that you need to have that will that will instruct the the framework here's where to go and here's the database provider type to interact with to to connect and work with the database so inside of several of the other.net frameworks there's a little bit of bootstrapping code that you can use to to automate this i'm going to do this right here inside of a method called on configuring and i'm going to create a simple connection string now you would probably pull this out of a um out of a configuration provider maybe it's an uh environment variable uh maybe it's injected on your hosting provider maybe it's stored in a in a encrypted file next to your project maybe it's inside of a key vault service and you're fetching it and injecting the connection string what have you um i'm going to call this write its data source equals and i'm going to call this appdb dot db and this is um the database file that i'm going to create using sql lite we're going to write and interact with to pass that in and and configure come on there we go options builder is the parameter that was passed in here right this is the database context options how are you configuring it what are those configuration options that we need to know in order to interact with the database i'm going to tell it use sqlite and that method was available because i installed the sqlite package and i have to give it i have to give it a connection string done okay so now it knows how to connect to this hard-coded database which might make sense if you're building a little console application and um start working with some posts inside that database inside that appdb i'm going to start up i have a database browser for sql lite let me get this started um i'm not going to install the new one just yet and i'll bring i'll bring that tool up when we're ready to look at the actual contents of the database so this is all i need inside my code to tell c sharp to tell.net here's how to go and connect to the database here's where the database is here's the database provider and here's the content that i expect i expect there to be a table called posts okay now now is when some of the magic starts to happen we're going to instruct dot net that there was a change in our mapping from c sharp to the database there's something new here we don't even have a database yet we've created here's the entries a blog post that we wanted to find that we want to live inside the database right we're we're writing our code first this technique is called code first and we're going to generate the database based on the code that we've written now there is another approach called data first where you may have an existing database out there and you want to generate the code from the database more on that a little bit later but i want to show you how to do code first first yeah that's right yes these are gunner glasses that i'm wearing um these are gunner lightning lightning 360s i think they call them lightning bolt 360s so um i'm a big fan of gunners i've been wearing them for years and years but recently i've been bringing them more and more help with my eyes with how much we're all sitting in front of we're all sitting in front of screens these days during pandemic it's definitely helped me so if you head over to my channel there's a there's a link there um and a coupon code you can click through and you can get i think it's 10 off if you buy a pair if you're interested in buying a pair of gunners so there are tools that you can use i don't like how that wraps um let me head back over to here we can just work right at the console and man that's gonna wrap too because i've got such a long folder name huh all right um i would i wish i was just on another line there for my prompt no matter um you'll you'll need the entity framework tools installed and um let me make sure i have the latest version so there's a at the command line there's an a noun you can pass into the dotnet the dot net command line um called tool and this will let you install and manage tools that extend your net experience ah what's that mean it means add-on things so you can work with database work with watching file watchers to trigger and rerun things if you'd like work with sql cache user secrets manage the development certificates that are installed with net core um i can execute net tool list and it will show me all the tools that are installed the local folder there's nothing here um i can pass a dash dash global flag and it'll show me here's all the dotnet tools that i have installed and you'll see i don't have too many 5.0 versions here but there's dot net ef 315. now i would normally if you didn't have this already installed i'd say net tool install uh net ef and it would install uh oh global and it would grab the latest version of the entity framework uh command line tools make them available for you but i've already got it installed i need to update so i'm just gonna change my verb here from install to update dotnet tool update dot net ef global and this will go and update to the 5.0 version there we go from 315 to 500. now this will let me connect to the database generate some code either to update the database and give it some of the information about the new code that i've created um apply those updates change the schema the the shape of my database appropriately to reflect the updates that are in my code or the other way around look at the database and update my code appropriately based on the state of the database i'm going code first so i'm going to generate my database my tables and my schema out there and we do that with with a practice called migrations so the migration defines here the changes since the last time we've updated the database it's a unit of change to be applied to the database and we define those changes we generate them by executing the net ef tool there it is right here um migrations is the noun that we specify let me see can i just that's not bad um clear dotnet ef migrations and the next and see it's wrapping because how long my folder name is there um i'm going to add a migration and uh let's call this add blog post so this is a name that i can give so that i can remember here's the features that we were applying with this change to the database so this will build my project and generate a little bit of code that will maintain the state of the database there we go build started build succeeded done okay it's it's so verbose you can pass in a verbosity flag so you can see a little bit more about what it created but i'm going to head back over to visual studio code and i do see a couple of questions there in chat i'm going to come back to you in just a minute i promise um and you can see there's now a migrations folder here and inside this let me open up this so you can see there's a couple files here right named after the date and time time utc when this was created that's actually not utc is it yeah that is utc um and if we look at one of these it's no not down there i want to see it no we can close that one um we can see it's got two methods inside of here up and down right so this class is named after right that that keyword that i gave it the name i gave it add blog post add blog post um so it has an up method and a down method the down method is what happens if we need to roll back this migration we're going to drop the table named posts posts is the name of that method that property okay um up is going to create the post table so create table named posts and here's the columns id title published utc and content if we look at my blog post id title published utc and content all of the properties are represented as columns in the table with appropriate fields to go with them integer text appropriate field types integer text the date time is cast as text because there is no date time type in sql lite and my content is text as well now look at this it generated a constraint for me it defined automatically a primary key a unique identifier for my posts table because i happen to have a field a property called id if you have a property named id or named whatever the type of your class is id right blog post id entity framework is smart enough to recognize that that's something that is a unique identifier and will automatically generate this table primary key constraint for you cool that's really great to see that it it's smart and it will generate this information along the way now we have a migration generated we're going to see how to apply that and actually work with the database here in a moment um [Music] vidal asks do i have any content to learn entity framework core you're in the right place that's what we're doing today um what's the name of that console that was windows console that i was using and customized you can find my customization over in my um it's not my dot files repository it's over in in um github.com c sharp fritz you'll see over there um a bit about that um let me see black guy has a question here let me grab that um there's some great content if you just want to go through training materials um and you don't want any discussion you can certainly head over to dot.net and click the learn tab and it'll drop you right in there's all kinds of material for learning c learning.net xamarin asp.net blazer great material there you can find as well as pluralsight when to let now a bunch of places on the net you can find that [Music] um so let me queue up a couple of these questions uh did they rename it from windows terminal no it's windows terminal that i'm using that's windows terminal i'm using powershell on here and i've set a background and i've installed poshgit to customize that further so okay let me answer some of the questions that have come in here blackeye asks um when would you go for a code first versus a database first approach so you've seen i generated i've generated some instructions for building my database and we're going to generate my database in just a second here i would choose to go database first if i already had a database if it was already being used for other applications maybe you have a data warehouse hanging out there a reporting database that you need to connect into and interact with then i would do database first because it already exists um otherwise i prefer to do code first because as a c-sharp developer i can think in in my familiar surroundings of c-sharp and it will automatically generate all of the appropriate things for me so that i have a good database experience then i can hand over my database configuration to a database administrator who can further tune that and we can make sure that all of our code lines up and works properly at that point so lots of options for how you interact with this but starting code first i think is a great way to go for a green field application a new application that doesn't have an existing database and then work with a database administrator to tune your interactions further once you start deploying um i see a question there from is it cademo i'll cue that up here another question from blackeye is what about complexity of an existing database would it be okay to try and do a first load with database first but continue with code first sure entity framework diagrams aren't a thing anymore that is no longer a thing you won't see that in in visual studio or anywhere they do not generate diagrams anymore and you won't be added there is no xml to edit everything that you interact with in entity framework core is right here in the db context there is no in in older versions of entity framework there was an edmx file i believe it was that was floating around that had the diagram so you could see exactly what this looks like that isn't a thing anymore so kdemal has a question here let's say you have a massive application with a lot of classes and thus tables is there a way to tell entity framework to point to a specific namespace to pull all your entities and create db sets dynamically no um you're trying to generate your write the the db context class no um that's that's something that you need to build on your own you can create many different database contexts if appropriate for your application maybe there's there's different um what do they call it in ddd there's different uh perspectives on your data that's not the right term but i'm going to work with it and and right the accounting group sees the data in this way so maybe have an accounting database context and maybe have a a warehousing database context that talks about all the things about managing stock levels in in the warehouse right those types of things bounded context thank you yes drazyak appreciate that that that's the term i was thinking of uh mario coins to you congratulations uh if you collect 100 of them you'll get one up um let me see here some there's a couple other questions coming in um um let me make sure i'm going to cue up just a couple of these real quick if the database admin decides to alter the tables maybe for performance tuning will that not break the code um if they if they're altering the tables if they're tuning the tables it won't necessarily break your code um if they're creating indexes they're creating views on top of them for you to interact with that won't necessarily break the code if they change the data types it may break your code at which point you can regenerate those contexts those those mappings using um and i need to show you there's a another dot net ef command that you can execute net ef db context that you can execute and it will let you scaffold a db context and entity types for the database so if if your database administrator is tuning and tweaking you can run with the scaffold command it will generate all of the objects that you need and you can merge those into your c sharp code your database administrator shouldn't be dramatically changing data types in production on the fly like that that's not something that you would normally see um nick asks so the database first in the new entity framework core will generate the classes yes it generates your database context and it generates your classes appropriately for you so the entire mapping uh you need to put your connection string somewhere in your code so that it knows how to load um is this sequoia asking what's the best way to secure api keys in a wpf app in a client-side app um well you need to fetch them somewhere um embedding them in your c sharp code isn't gonna work so you're gonna need to have them protected somewhere data protection services is one way to do it you're going to need to fetch them and make them available somehow [Music] i mean api keys are going to be interacted interact are going to be um your folks are going to be able to find them one way or another so be ready to invalidate them um a secrets app like azure key vault that works as well but something going into a wpf application you're interacting with a twitter where you have a an api key or facebook or you have an api key you're going to need to put that somewhere where you can fetch it securely and have if if they're able to look at memory they're going to be able to see it sitting there so for wpf you're already trusting people to use your application so there's a level of trust that you're passing along to them no i would not use variables environment on for wpf no um [Music] i'd even be tempted to stand up a web service that would provide a gateway to your other apis that you need to interact with in that web service use windows authentication so that you know the person using the wpf app they're authenticated into the web service and that is doing the proxying to your third party service now we're not talking about it just talking about that question about wpf um no there is no way to generate a diagram [Music] um so we're doing basic crud today don't want to get too far into it okay so we've created right we've created this um [Music] this migration how do we actually apply it to a database and in the case of sql lite i'd like to have a database file here that i can work with dot net ef has a tool for you called database so dot net ef database we're gonna use the database noun and we apply a verb command we can drop the database we can update the database to a specific migration or if you don't provide an additional argument after update it'll update to the latest migration that you have so i've only got one so i can say dot net ef database update and it will take those migrations that haven't been applied and since i don't have a database it'll go and create that builds my application because it needs to grab those latest migrations that we generated get them into as real code build succeeded and now it executes that migration and we get the ever the the ever helpful done statement that's let me do that again dotnet ef database drop go away i don't want to see that anymore building [Music] uh yes i do want to drop it thank you so but right there was an app dbdb here on disk sorry i wiped it um so let's do net ef database update and let's pass in a verbosity let's tell it to be a little bit more verbose okay and it's going to tell me all the things it's doing along the way here just in case you want to know maybe you've got a database administrator you've got somebody that wants to know a little bit more about what's it actually doing and you can see exactly what it applied check it out when it right so when it's come here come here you built right it built the application no errors build succeeded.net exec and it's going through and getting ready to build my database right creating database command for execute non-query and it actually wrote the database out here i'm looking for there it is open connection for database main on server and look there it is appdb.db okay and it created a table because it didn't exist yet called ef migrations history this is where the database tracks what version of the migrations have been applied and um yes executed it and it put a primary key on it another constraint make sure that the product version is not null product version is net five in our case and then it applied the actual migration apply migration so right here's where it inserted and oh actually it didn't insert it just said there's nothing there so it created the table posts because that's what this said to do we saw a create table post and it applies the constraints right appropriately for us here um executing and it inserts into the migration history so it knows there's the file name for that migration it applied and it was using ef core five right so now we know that's that migration has been applied and because the migration is named after the date to start with we know that they'll be applied in the appropriate order because they're ordered by date [Music] looking here trying to catch up um okay so now if i take a look on disk there's appdb.db and it's allocated 20k for it i'm going to go over here i have a database browser for sql lite you can also um you can also run a database browser inside of visual studio visual studio code i'm running this one so it's outside and a little bit easier to pick up and see what's going on so sessions ef core sample entity framework there it is appdb so there's my my tables that i have posts uh ef migrations history and if we look at posts it has an id a title publish utc and content just like we expected it's all there for us okay we've got a database we can work with let's get into actually writing and working with that data so we've got migrations let's let's write a blog post let's put a blog post out there for us to work with so we create a new database context new app db context real easy kind of makes sense as that's being instantiated and it gets configured for us to work with it'll execute this method so we get it all configured it knows how to interact with that sqlite database and we can start to get data write data all that stuff so i'm going to start with a method called get posts real simple i'm going to pass in my database context and i mentioned the posts property behaves like an eye list like a collection that you can modify so um i'm gonna first call the as no tracking method on this right um that says we don't need to watch any changes we're only reading the database otherwise as we interact with data in the posts collection entity framework will see those changes track them store them in memory and we can save those changes back we'll do more with that in the update segment here in a second so um get that list of posts right it returns an iqueryable of posts write an i queryable is just a collection that we can query through it turns into sql for us when we actually enumerate it when we actually start to look at the data inside of it so if there aren't any posts write no blog posts found and exit nothing more to do here if there are posts for each for each record in the posts collection just write out post to string and i i put a little dummy helper method in here to string and output title with the id of the post so if i run this now right not dit dot net run this is just a console application um and i'm in the wrong folder that folder dot net run uh dank scooter your spoiler alert that's something i can absolutely show you here in just a second there we go no blog posts found there's nothing in the database it connected into the database queried the records didn't find any and told me no blog posts found so let's add a blog post [Music] let's write our first post to add to our database so we're gonna be past that same database context and i'm just gonna create a new blog post object title my first post published utc is now uh content this is my first post i'm very proud of it so i was mentioning it's an interaction it's a we can interact with that post collection with things like add right check this out if i'm going to do a control space here look at all the methods that you can execute and interact with that collection right it's it's a link collection that you can work with count sure find first um from sql you can actually have it execute some sql commands directly if you'd like join into other tables sure um min max write the aggregate um uh arguments the accurate aggregate methods you may want to interact with single i just want one record out of this skip a certain number of records take a certain number of records from the from the collection to array to dictionary to list update where there's your conditions if you want to add those so very clearly right from a c-sharp developer's point of view it speaks my language i know how to do those things so now that i've added this i'm going to move actually my get posts method below add post and i'll rerun my code which will now add that post and go get the list of posts there we go my first post and it's id one now i didn't set an id and the id here doesn't have any indicator that says well this should be value one here's the thing if you have a column called id by convention it will set it up to auto increment it will automatically start counting that for you you don't have to set a value there it'll set it for you and when you look at the data afterwards you'll see the value that entity framework created for you so nice easy way for you to interact and learn not learn but but generate these values for you where i don't care what it is just go create go create my my post in the database now there's a couple different ways that you can interact and see the sql that's being executed now i wrote down i wrote it in my notes over here um yes yes two query string in log two that's right so when i was um let me i don't want to add that post again so i'm going to comment that out in my get posts method here right so here's my query i can i can actually and this is an iqueryable still it hasn't been cast to a collection yet it hasn't been evaluated yet um i can get the query that's going to be um that's going to be written out here i could say console writeline um posts right um two query string and this will give you no no no this will give you there you go generates a string representation of the query used right it may be okay to execute directly but for debugging you'll be able to see exactly what it is executing so if i add that no i didn't want to go back there i wanted to go here and run the application again so it's it's going to do the fetch but it's also going to output well here's my query string there select id content published and if you're familiar with sql that looks pretty standard sure right if i if i put a little bit more information on here right and i said uh fingers don't fail me now here we go uh where p dot id is less than 10 right do a little bit extra in my query there run it again and now there you go it generates my where statement appropriately for me right and we're still very basic we're at the very beginnings of this but dang scooter that's one way that you can see the sql that's being that's being generated um another way to do this is inside your um your db context there it is right there when this is being created here i believe this was just added with entity framework uh any framework core five uh there it is log two and i can specify how do you want this logged it's going to log information where would you like it um so console no console right line i need a control dot there give me my using statement so just write it out you could tell it put it into some sort of a log location um and i'm going to tell it uh log level um give me everything give me all the information um so now for every command that's being executed it's going to write out here's the code that that i um that i generated so dot net run there we go so you see it logging here look um right initialized appdb context using provider sql lite with no options uh to execute db command here right because i did um it first checks to see well do i get any records with this right select one don't actually retrieve any data do i get anything back because that executes extremely quickly um right 10 milliseconds okay now go and do the select and here's the data to populate so now i've got some interaction now i can pass that off to a database administrator or someone and they can see exactly what's going on and tune a little bit more appropriately so that's the log two method that you can add into your options to get it to log these values for you as it's interacting so as no tracking there's a question there and and let's talk about that as i do the update next the update interaction um let me i'm not qui i need to read that a little bit closer is that ismail malaqui let me get back to your question here in a second um this leads right into our next discussion here i'm going to turn off the log too but leave that in the code as a reference what is as no tracking so when i was interacting over here as no tracking says this is a read-only interaction don't track any changes to the objects um because i don't plan to make any changes and if i do i'll tell you what the changes are so if i'm going to update a post in the database right update posts i can say we'll go find this post i turned off as no tracking go find that post because i'm going to modify it and i've updated the title i hacked your post um and go save those changes database save changes right persist those changes back out to the database so because i turned on the tracking act let me so that you can see what's happening you know what i'm going to turn back on log2 let me turn that back on so you can see this right so now let me run this and you'll see that right i hacked your post it has a new title and we can even go look in the database and if we open up and browse the posts there you see title is uh you're not going to let me you're not gonna zoom here are you no it doesn't have a zoom rats um i the title has changed okay i get it um when you look at what's happened here right select it went and fetched my data just as i requested limit one because i told it first right so it only gives me one um we made our changes and it executed here database command passing in some text and it's got some parameters to set the title there we because we updated the title there's parameter for the title is p0 right um that's where is it where's that set execute dp command db command that's the select i don't see the parameter being set um and p1 is the write the id of that the key and updates it and selects the changes to make sure that it did appropriately change and it returns to me here's the object because i said get posts there it is and there's the end the results so save changes you don't have to identify you don't have to remember here's the things that have that have changed inside my database entity framework will do that for you while you're connected now when if you're if you get disconnected from your database like in the case of a web application where you send down some data that data comes back to you and you need to now reattach an object track those changes that you're applying and save them that's a little bit different right your you now at that point need to reattach the method is attach so that you create a new object attach it or you select out the existing object so that you get that copy update it with the changes that were made by your visitors and pass it back the other thing that that you may see here is you can't do sql injection with this all of the the appropriate guard rails are in place here that you can't inject sql with entity framework or i can't i can't change my title to right i can't change my title to um [Music] um right if i go through and i try and do that right a typical sql injection type of attack um dotnet run it it it updates it so that that is my title it properly escapes and i get that returned so you're protected now from those types of attacks on your application um ismail asks regarding sql raw queries the alternative method entity has no key to view for ignoring entities seems to not be working i that's a question for the end of the framework team you're a little bit further out than i want to cover today um and that would take a little bit of investigation on my part so i'm with respect i'm going to pass and ask you to post a question on the github issues for nd framework core or run out to the visual studio community website you can create an entry there and they'll be able to help you with that [Music] um netjam jr asks can you implement i property changed on the class entity framework returns why why would you want that you're the one who's updating it and it's in it entity framework is returning your poco object you can certainly implement i property notify changed so that when these properties are changed they raise an event that can be um observed and behave appropriately sure but they're not being changed by entity framework they're being changed by your code so not quite the same [Music] i think there's better ways to do what i sounds like you're trying to accomplish you don't necessarily want to be pulling the database and when an object change changes raise notification there's ways to set up cues and notifications from the database as things happen to send out notifications using pub sub type of architecture and broadcast and paint those updates so that's that's a different concern that entity framework isn't going to help you with um okay you may want to send notifications broadcast notifications when save changes happens on a particular object and and use that to broadcast notifications but entity framework isn't going to do that for you so okay we've updated records let's see about the leading records delete is it's just like a collection right so let's take a look at this database posts remove and when you want to remove an object from the collection you have to pass it the object in the collection you want removed so i want to remove that that post that that's since been hacked and it looks like little bobby tables was trying to rewrite the content of so let's go find that and remove it we execute save changes again and give me the list of posts i will activate that sample now and we'll be able to run the code and it should wipe out the content of it there you go no blog posts found and you see all my log information being output i'm going to remove the log at this point you're welcome to use that in your code in the future but there's no blog posts in the database now fantastic right um so i've right and i can save that go get the posts and regenerate and now i'll have my one post in the database there we go my first post two because post one was deleted okay now that's great we've done simple crud we've read data created data updated data and we've deleted data but there's also the question of well how do we get some relational data how do we how do we create a primary foreign key relationship what's that look like what's that behavior what's that configuration how do i do that so let's go back over to our blog post and uh go away let's create an author right so let's create a public class author let's scoot you up a little bit here let's make this very simple um i'm going to use my snippets here to create an author uh authors have a name authors also have an id right there we go um and let's give it one more property here uh twitter username all right now we want to relate authors to our posts so that we can both go from an author and see all the blog posts that they wrote and also from our blog post go in and see the author that wrote it right because every blog post has one author more on that later start simple one author so what i can do is inside my blog post class here is i can create a reference to that author and this is going to feel a little bit too easy so there's my author and i need to actually get a reference to the author's id and keep that here also right that's kind of good database practice so no i want an int for the author id and there we go now the author has a bunch of blog posts okay so let's create a property over here and this is a right is it i innumerable is that what i'm thinking i think that's it uh where's the db set i think it's innumerable it might be db set um if only there was somewhere that i had already written the code for this and i could go back and reference and make sure oh yeah that's the way that i was supposed to do this yep i enumerable i was right [Music] which makes it a little bit trickier to work with but no matter um so this is an innumerable of blog posts and we'll call this posts so i've created a c-sharp reference between these two a relationship an author has posts and an author exists on a blog post so let's move the author out into its own file but i've now created i've changed the shape of my object i've changed this the shape of my blog post i need to create a migration so um let's create another migration net uh ef migrations add add author and this will build and identify what that relationship should be between blog post and author and create a migration for that and there we go add author so we're going to add the author id to the posts table and then we're going to create a table called author with id name twitter username with a constraint primary key author and it automatically creates an index for the author id on posts as well as a foreign key so that it knows the relationship between these this is good database design being delivered for you no extra charge it's free comes along for the road so yeah we're going to get into many-to-many in just a second which is a whole nother kettle of fish so i've got this out here now i can create let me go back to where's program now i can add a post with an author well actually no i can't hang on hold the phone um we need to update the database what dot net ef database update now if i tried to interact with it it would throw an ugly error for me because it doesn't know what the author's table is yet oh look at this oh my gosh what happened i broke something um this worked properly earlier today isn't that always the way applying migration blah blah blah blah blah blah blah id author id content why what did i miss here go back to the code that worked int author id author yeah um you have temp posts oh you know why because it's got a record there that doesn't have an author id so um here's what i'm going to do dot net ef database drop [Music] yes oh i still have it open over here um close database do it again um we could make author nullable yes uh tell you what i'll go back and do that standby uh where was it blog post right i could right yeah i have whatever i could make this nullable like that actually um if i do this and now uh it's not finding system components um right i don't think it's not null no nullable author yeah nullables are they end with a suffix of a question mark there we go so now i should where'd it go [Music] up here nullable author right and if we look at this nullable true so um honestly what i should do let's let's do this right um net ef migrations right um i should remove and then remove again and then regenerate right and we'll re-add the author so it's not changing my c sharp code but it's removing the code to interact with the database right now do.net ef migrations add add author [Music] there we go dotnet ef database update and it'll update my database there we go applied to migration so if i go back over here and we open and we look at the database again so i um that's the author table if i look at posts this is my first post there it is okay so the post is there it doesn't have an author that's okay that's legit you're allowed to do that now because i made that author id nullable right with a question mark so now let's create let's create a record with with an author you'll notice i didn't add a db set for authors you can't create an insert authors and and query against authors from here i can add that later if i'd like to but don't have to do that so let me there it is program so let's add a post with an author so here we go add post with an author so we're going to create a new author name is jeff fritz i know that guy twitter username c sharp fritz and he's got a new blog post author equals right we're assigning the author to this it's that new person that we just created title live coding with twitch content today is my three year anniversary live coding on twitch that's true here november 23rd 2020 it's my third year live coding on twitch all i do is say posts add that new post and save changes and it will both create the author record and create the blog post now if i already had an existing author record out there i could grab that author record selected out of the database and attach it to this blog post or i could set the author id property on the blog post from that existing author that i already knew about maybe i selected it in a drop down box or maybe it's an id that's associated with the author that's logged into this application and writing this blog post i can grab that id and attach it to the record instead of attaching this object and it would still propagate all that information so um let's run that so yeah thank you chris three years here on twitch so thank you very much caporino kerjax surgdev pc nerd jb1t much appreciate so author does not contain a definition for twitter username did i i thought it was uh twitter username right author what did i call it yeah twitter username what do you mean oh look at that i changed the caps rerun that build and run here we go yeah the casing it should have picked that up um here but there we go.net run and it didn't output anything i forgot to call uh get posts comment that out do this save rerun it and now i get live coding on twitch and my first post they're both output and now we can see and interact with that data and query it a little bit whatever you might want to do terrific okay so now we've created multiple records now the next question is what about many to many and and i wasn't sure if we were going to get down into this i wasn't sure if this was going to be a question i should have assumed it was going to be a question because this is one of those sticking points that a lot of folks run into gosh i'd like to know more about how to do many to many right and the typical scenario that you you see people show as a demo when working with the the blog engine scenario is what if we had tags that we applied to our blog posts right you might have um right these two maybe they're both um personal blog posts and and maybe there's twitch blog posts and and there's technical blog posts and all these different tags and each post has a collection of different tags applied but each tag can be applied to many different blog posts so how do we do that how do we interact with that how do we create this many-to-many relationship well when we work with when we work with any relational database in order to create that many-to-many you you actually need let me let me build a diagram here oh and i'm gonna have to attach an image to this oh that's gonna be fun um let's create a all right so delete this right um right so if i have right um blog posts right um bump up that font size right and i want to assign tags to them right we're going to have right tags and we'll bump up that font size too right in order to make the many-to-many relationship between these right it's not one-to-many it's not one blog post has many tags and that tag only belongs to one blog post right this is the many-to-many relationship which means you need some sort of a middle table that is blog post tags right um and what you end up with is blog one blog post has many blog post tags and each tag has many blog post tags so you end up with this middle table that you need to represent so that you end up with the one-to-many relationship on both sides of your of your objects and of your um of your database interactions so how do we do that how do we get this set up so let's create a um i'm gonna have to write the code by hand on this plenty of time we've got about 25 minutes to go here friends let's uh let's do some live coding live right um so i'm gonna go over here to blog post let's create a new class public class tag right and a tag well a tag really just has a uh uh some text to go with it i could put an id on it ah let's put an id on it sure um id right string and it's it's the name of the tag right um and on my on my blog post here i need some way to have that collection of tags what's that look like how do i get to it so we create that many to many inter inner table that join that bridge table so blog post tags right um create a property here int and this will be a blog post id uh this is another property and this will be tag id see where i'm going here oh we're almost there um so right this can actually be a blog post blog post and down here um [Music] yeah right uh tag tag so now up here inside my blog post let's make sure i'm doing this right um i'm going to have an i innumerable of um blog post tags right um and this will be um [Music] yeah uh blog post tags right and you need to know what that is cool still don't know why that's not picking up there yeah don't you know what author is author is there there is an author object um so it knows what this is this knows what that is and our tags need to have a collection of blog posts that go with them so i'm gonna set up another property i innumerable um blog posts tags right blog post tags and now i have the two-way relationship that i can go through here nope you need to create you need to create the middle class here in order to get it to go through [Music] is there an automatic many-to-many i haven't i haven't gone into that looking for the docks looking for the docks i don't see docks looking looking there's i see plans on why am i not seeing this in [Music] yeah that should that should probably be i list shouldn't it so that it allows me to do the ad yeah i don't see it [Music] so there was a way to do this yeah the old way to do it was to specify has many but will it do it automatically now this was the way you used to do it and it would go and detect and find it did they um yep blog posts right can we do it just this way um not tags tag um and i want to be able to find those so i'm gonna let you go from a tag back um tag and we'll call this tags so that i can query from the top level on a tag and go find all of its blog posts um and i haven't even done the join yet on the get oh we gotta show that so um i think that's everything um let me go back over here [Music] uh dot net well first off let's dotnet build make sure that works while i'm going through here there's a question from get it though asking what's the difference between a database set and then i enumerable i enumerable just generically defines a forward-only collection that you can interact with you can query it and it only goes forward you can't it's also read-only you can't interact with it db set has all the interactions so that you can modify it filter it delete records from it and it will appropriately propagate those back to the database when you use ef core so um all right so that did run dot net ef migrations add um add tags see what that does um i i haven't tried this yet so because i'm i'm used to using any frame record three one i haven't gotten into end of the framework five yet so if i do net ef database update what do i get [Music] there we go applied the migration all right so if i go back over here and we look at database structure we'll open there it is right there so it generated the blog post tag for me cool posts tags tags have an id and a name so it's a collection collections are by default zero to many there aren't required for it so i am clear there i can start interacting with and adding tags to [Music] my uh to my blog posts now i didn't um i didn't show how to do the join and this this is a an ef core five feature like i said previously you had to create the middle table and do the join yourself but yeah ef core5 does this for you so i'm going to drop back over here to my program and this time let's um let's create tags and add to first post right and i'll um let's also get post with i'll just update the get posts let's move this and leave it up there and we'll there we go and we'll get the posts and now put it down here there we go um i want to move this down to the bottom so that these are in the order that we executed them for folks that are watching the recording so they can see this um and get posts [Music] here um i'm going to add another let's just copy and paste this i want to get the information about the authors on this so i need to actually um include right uh author right right what am i missing here uh comment that out i want to do a join include should have grabbed it for me [Music] right include um there we go that's what it so it's going to include the author um and there is another helper method here then include to attach other tables that you want to join into so the first one is include and then you have then includes to set up the various joins that you want to return so let me go back to my deep my blog post i'm going to update the string and say written by right and i can say author dot name really you're gonna you're gonna give me this nonsense it's there you know it's there all right so add post with author and we still have to write the create tags let me comment this for now and let's make sure that that no don't run make sure that it formats and shows you everything with the author there object reference not set to an instance of an object ah because there's no author right in the tostring so um if uh author equals no right we'll just get rid of that uh if this was vi would have joined join the lines there piece of cake but it's not try it again there we go my first post and there it's joined in and it has the information about the author so now we're seeing more complex queries to fetch data out now let's go back and do that many to many and show fetching while adding that data and then fetching it and presenting it so i'll scroll back down create tags and add to first post so um let's create some tags uh let's create a personal tag new tag um right name equals right um and uh let's call this uh tech tag sure new tag uh name equals uh technical right these are different cat tags for my blog posts um and uh let's take db tags um i can add range and give it a collection of these so let's add the personal tag let's add the tech tag and now i can i can save changes but i don't necessarily want to save changes yet let's go grab that first blog post and assign the personal tag to it grab the second blog post assign the tech tag to it and then go and bundle up and save all the changes so i'll say db posts i'll use the first right which will first no i want to first is fine um first where um actually um let me do let me do order by yeah uh order by the id because i want to grab the first one make sure that this always works for folks that are replaying this in the future so i've got the first post right capture that and if i say um first firstpost.tags.ad and i need to specify the tags to add well add the personal tag um let's grab the second post right and this is completely completely uh uh made up for the purposes of this demo um skip the first post grab the next one and on this one tags add um it's recognizing my twitch anniversary so i'll add the personal tag and i'll add the tech tag okay now i can go through and say save changes and this will save all the changes to both the tags and the posts all in one shot so now i'll go back to blog post and um if um it's not tags null but if tags if um yeah let's tag text right we'll say tags text equals um right uh tagged with and we'll put it we'll put a collection here right um so we can say uh tags um string.join and let's join these with a comma and it's going to be um tags dot oh you're not gonna let me do this are you [Music] yeah i want to do a tags select give me that and i want to grab the tag name there we go and we'll add the text text on hold on here we go that's a lot of code i wrote make sure that works cool um no the the cursor smooth moving that's a uh feature that i turned on in in vs code i forget it's like smooth scroll or something and it's in all the visual studio codes um chris jones i'm going to pin that question we'll come back to that in just a second i have five minutes to go here hold on friends let's see if this works so i'm going to run it's going to go and create those tags load everything out there oh tartar sauce object reference not set to an instance of an object down on 106. first post tags it didn't find all right it should have done all of that at once but i'll save changes i'll do the middle safe changes along the way here [Music] you're gonna do this to me huh 107. tags isn't a collection yet um [Music] so shoot it's going to create two more tags for me [Music] over here browse data tags see there they are uh delete that record delete that record right changes try this again i don't want that to be there but here when it's adding the tags um i want to say tags equals new it's in it's an eye list right yeah i should initialize this right if i were to do it like that um right that should work that should work right try it again let's see here we go all right now it it did the get uh first uh no it didn't pick up and show the list really what do we got here database structure refresh so there's the tags blog post tags yeah that map oh you know what i didn't so here's the import i didn't include on author if you don't include the related tables you want to fetch it won't present them it won't present that data it will kind of silently ignore it because it is attempting to lazy load that information so um not then include that include would be if it's jumping through the author object i want to get tags there we go and i'm going to turn off the create and assign let's see if we can get them loaded for us and output that appropriately yeah you're right two eight now you could put the new on the end there and it'll pick it up there you go um i didn't where's the tostring there we go tags text i didn't include tags text up here on this one because it didn't have an author um move that down here right if we try it one more time we should now get tags for all of these things so that it's jumping through nope didn't pick it up oh silly me there we go there we go yeah you need to initialize the lists there we go so now the there's the tag for the first one tagged with personal and the second one and i can go the other way right i can go from a tag and see the various blog posts that are associated with that if i wanted to so [Music] um there was a yeah slightly james you were right there was a question here from chris jones what are my thoughts on adding the repository pattern and i need to wrap up here what are the my thoughts on using the repository pattern in conjunction with entity framework core i don't i think there's no such thing as too much abstraction adding another layer of abstraction because you're using entity framework core behind the scenes you may change that later because you're going to fetch data from a different place to work with i think that's just fine if that's something that's a possibility in the future otherwise you're over abstracting your data friends that's all the time that i have for today it's been really good to be with you let me head back over to the code to the front screen here thank you so much for tuning in we're about to lose learn tv thanks so much for for watching all of these videos are available over on the dotnet youtube channel where you can find the c-sharp with c-sharp fritz playlist all the links to all the samples on the github repository issues out there for you that you can click through all the questions that you've seen as part of the video today they're answered and linked directly in those in those um descriptions of those videos thank you so much for watching and i'll see you next week when we'll start talking about asp.net core
Info
Channel: dotNET
Views: 7,120
Rating: undefined out of 5
Keywords: .NET, c#, c-sharp, .net core, .net 5, entity framework core, ef core, csharpfritz
Id: 4LRUWCfGLIs
Channel Id: undefined
Length: 113min 30sec (6810 seconds)
Published: Tue Dec 01 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.