Articles, Blog

2020-01-22 (VOD) Learning Entity Framework Core (EF Core)

February 13, 2020


Bonjour hi this is a recorded version of a
live session from twitch it will be a very long video and that’s why I put
timestamp in the description so you could skip and go directly to the part
that interests you if you want to know exactly when I’m streaming go visit
twitch.tv/fboucheros but for now let’s watch this session there it is
hey I was just saying why are you waiting on the button and as soon as I
show up boom thank you again for three months this is awesome
so I’m frankly she Microsoft cloud advocate and I like to stream and learn
things I’m part of the life coder here on the at which you can see all of them
on live coders that dotnet um there is many iminium of us I think we’re more
than how many like it’s definitely more than undreds but I don’t know how many
hey TV gamers how are you good afternoon so yeah so I like to stream to learn
things that’s my way to learn so I decided to expose myself and try
different things and on a project we are working on called use your vote we did
install social login to identical so that’s cool and I want to have some
entity in a database and things like that but it’s been a while since like
like very very very long time I didn’t play on entity framework I
think last time I did play with entity framework I was using VB so that’s a
very like vb.net but like I at the early days so it’s like I never did any entity
framework so I just want to get back to it learn before screwing too much or
project so today I want to start a new project from scratch hey thanks for the
following why not know when when that’s what adds ha welcome welcome to the
stream I need to expand that and I just realize it’s on this side I need to move
my background ah that’s better more more again yeah was that sighted I need to move the cloud that’s the
power of azure what’s V be exactly LAN market to his been a while it’s been so
knows it’s been I’m not even sure I had my daughter I think yeah I had my
daughter but she was just a baby you know she’s getting closer to 18 years
old so yeah I’m getting old okay so so that’s the planner of the day
so I don’t know if you know entity framework but alright like I know what
it is I did poke around a little bit long long time ago like I was saying but
we’ll just assume I know I know nothing and yeah we’ll start learning build a
new project have some fun and next week next week if we feel enough comfortable
I will start implementing the base class in user vote also let me share my screen
where is it I think it’s that one yes so we’re just searching for it get started
I just want to get back here to our project whoops Oh so and use your vote I will need to do
some cleaning because I screwed up when I moved around the code as it’s probably
too small let’s zoom a little bit that would be better my goal was to move the
code in SRC for source but then I still have the another copy there so there’s
two copies and everything so I will start cleaning it and anyway we we don’t
have much yet we just have an empty project with the social login that can
be redo in a few minutes the thing I want to keep is the deployment section
so probably delete though this holder in this folder and just start from scratch
and we’ll build the new the new project I think it could be interesting to have
like a project web project like domain data and test and having like all those
separate projects so it will be maybe easier to maintain but today I think
today I don’t know how we’ll be doing I will be following the tutorial to learn
and mess around and try to break things because that’s how I learn they say turn
right and ok let’s turn left let’s see what happens so that’s the goal so
eventually if you follow this project I doubt because there’s nothing just
kind of a raising a flag here I will clean it up so let’s get started when worker 2 is been so long my friend
how are you and now I’m stating I did put the last version on my PC for oops
haha I move the window and it closed everything I I’m very tempted to use
visuals till 2019 like the big visuals oh because there’s a lot of automation
and like scaffolding and tools like that so it’s very tenting but at the same
time if I want to learn I think if I type more I risk to have a better
understanding so I think I will go with Visual Studio add a code I mean I’m not
sure any opinions in the chat should I go oh like oh let’s try that let’s try
that let’s try that I have can’t do poo I think
can I do I think I could cool where’s it managed pull create a new
pool I’m trying to new interface here and
I put one minute so on the top where I am so in the top above the chat oh if I
go okay so just here you should have a vote so you could pick select what you
think I should go and try so yes I had a landmark to had a great
holiday it’s kind of a for me was a bit crazy why it was good because no
traveling but then I was still traveling but for the family so fantastic it’s
that’s 5050 ha ha ha well that’s useful see the result because I want to learn
I’m scared that if I learn animation since a lot of time I’m running from
Linux I won’t have visuals to do so I think I will go whose watch is your code
that’s the reason that’s why I’m like it’s a 50-50 so I think my vote now is
I’m the one making the balance so I think I will go and pick visuals to do
so that’s the notes and you’re not like there’s we can do both so let’s try this
so here they say just donate new console okay so let’s
I don’t need a console but I open it anyway huh so where should
I put it there i I do this here and this here that’s
good right okay so now let’s open the terminal terminal I said voila
and now we’ll go in my folder for development well that’s better okay
so now let’s create a new project so that net new a console application and
do something web are you know what let’s run by the
beginning let’s let’s get started but that’s that net core did I switch let’s do a console application no UI so
maybe it will be easier to understand what’s happening cool so how do we call
it let’s do a console is it big enough I will be better right
and this this page should be good enough but the code okay so now let’s switch in
this one and open it in Jos code so – our will recycle that visuals to your
code so I’m reopening left the folder inside this visual so codes I’m not
opening another instances instance no plural okay cool so now I need a provider okay
there’s many providers I think SQLite is good I don’t have anything installed and
I didn’t start my daugher so yeah let’s do but there’s a lot I didn’t know I
wasn’t compatible with all those database it’s pretty cool wait okay so yes I have my lamp in my way couldn’t
see what I was typing so let’s open again terminal so now I need to add a
reference because if I look here there’s nothing that says that I need an entity
framework so well this there so now I have here my entity framework provider
and it’s SQLite that is added I feel like I should can I collapse this that’s
always a question I’m like I would like to collapse can collapse that if I
continue to compress it ah there it is wonderful this way we have more place to code excellent kukuku so create a model define a
context class and an empty class that make up the model in the project
directory create a model okay is it again to toggle the I need new days because I get so tired
of all the same old stuff it’s never enough so let’s turn it up and fire control-v yeah that’s right that’s not
what I did I did control shit VAP engage okay so so now I have created with are
they explaining that this framework or can also reverse engineer model that’s
fine but I like the code approach so now I have a context to be context that’s
blog okay it’s creating everything I see I don’t like that you just put
everything like indeed create yeah so I have a model something so that’s my data
kind of thing and that’s let’s break it in different classes does it change
anything okay so I have some DB contacts and now
I set a TV set what’s a TV set okay kind of a data set
right got a base set blog and posts the to class are defined here so they are
get our setter and then I do with that on configuring okay it’s just getting my
connection string okay okay okay right that’s cool and public’s all those are kind of local
class right if I remember correctly and now a blog has a list of posts and posts
it’s post ID title content and a reference to a blog so to make the
reference to the parent need the ID and the class that I remember was always
confusing me so to identify the parent I need two things for the child Justin
yeah I have a ton of those okay cool great now create a database cuckoo cuckoo cuckoo cool exactly did I
just say that trying to understand put you at my place it’s not that
comfortable but like I don’t know it so I’m just learning it okay
create a database step use migration oh yeah that’s a thing yeah yeah okay so so
an azure cell I need to do a dozen it install global and streamline
okay so dotnet tool install and now I put that global dotnet and T framework so you can invoke the tool using the
following command dotnet entity framework okay cool
and now I want to do a deck net I add another package that one is Microsoft
entity framework design oh and here it says specify what it is
so entity framework design package which is required to run the command on a
project the migration come in scaffold and migration to create the initial data
set table okay excellent clear now I want to type that come in
nope Automation I want to learn and remember or a day or two so that net
entity framework migration so I’m talking to the migration and I’m adding
initial create migration ah it did create Fewster so
that was a snapshot okay and this initial create designer okay so that generate cool interesting
and now I need to do entity framework that net database update what I should
do mr. mister if you are interested I open the my
discord so if you want to join I have two spots I think where you can talk if
you turn your mic on and let me share the link the invite where is it invite
people well the URL is end up behind me and it’s switching some time over but hey Ellie okay whatever I don’t find that the URL
don’t spend time on that too much okay so that I run the command for updating
the data things I don’t think so right it was the initial create so now I need
to run this so entity my Gration no entity framework and then
don’t net that’s the framework that days and I say update it’s like one is
migration and the other one is database so currently the migration has been
applied my connect to that data I think are something like that it was blog in BB it’s very light that team is I’m not
sure it’s SQL server I thought I will be able to connect but that’s okay I know I couldn’t connect with Visual
Studio probably with Visual Studio code also but I could with the scissors to do
so now they won’t need to go in program and we plays the content by that and
we’ll do it blindly of course now let’s have a look and that net run
no no let me have a look first so using my context so that’s fine
we’ll create a new context of the class we did here okay
so but when the unconfigured is triggered insert new blog so it had a
URL and save change and now DB that’s our context yeah okay that’s kind of a
little bit it’s a little bit basic but that’s fine I could just DB blogs order by no I don’t I cannot hear you I see let me mute to my music try again
I see it looks like you’re speaking I can I should maybe I need to unmute you
or something no you are already on mute I’m assuming you can hear me through oh I think I heared something that’s
microphones I do yeah I’m clear alone it’s working
yeah well what was wrong what when what did I just let you know I don’t think so
I’m ready okay I’ll just can I start the music still I think it was just different I think the other day I was
trying to send the sound through my bluetooth headset and I changed some
config and look like this chord got stick with that configuration so I just
put it to default and it worked again what classic yeah yeah but since I
didn’t touch it but I don’t I want to use more discord because there’s a lot
happening there but there’s too much stuff to do
yeah you had another suffer to learn or to use right though exactly
we were like so happy when we just got the email and maybe ERC back in time now
we have to deal with a bunch of you know social networking you know that’s so
many stuff to do right but like yeah but I think it’s really cool because you
know we can chitchat we can talk it’s very convenient but oh
it’s it’s awesome I mean like you can reach a lot of people with it if you’re
it is so many thing you can do what you know you have to agree with me it’s
still so many software to install so many thing to configure you know a B oh
yeah you can spend like any you know in you stream it though just an art to
figure out things up and then you realize hey the stream is just up and up
and then you didn’t do anything right so yeah that’s that that’s one of the
classic great anyway I saw a couple picture of you
doing some speak in front of a lot of people yeah you’re giving you’re getting
a bigger and bigger not not you like your physical maybe a minute I’m trying
to keep up man yeah Christmastime right yeah I could
like picture of you like maybe a two thousand three thousand people and must
be frightening right I was yeah that was very like that was
in Orlando the big ignite yeah you know yeah yeah so when I was looking at the
registration it was four thousand and I was like what and then of course people
you know when you look at the schedule you picked bunch of stuff and at the
annual you overbooked and you pick only one when you go through one session so I
had somewhere between I think it was around two thousand so I may be a little
bit more yeah III don’t I don’t want to you know say – right yeah exact but you
know around two thousand still very a lot of people and a huge stage with it
amazing so I was pretty cool person like in front of you need to do and you know
sure you’re you know – it’s it’s still frightening yeah but I look at you like
let’s say look at your speech like we’re speaks like engagement like a year ago
and now you know it’s it’s amazing the what you accomplished so far right so
yeah it’s very fun and I I went in France was pretty cool too you know you
do traveling a lot right yeah I went to China I was very special very
interesting and now Friday I’m going to Milan Wow
amazing that you got you got a chance to travel with off your family your wife
they are not listening that but the the streams like yeah like I like you know
like when it’s not too long it’s like it’s very enjoyable I think I always
said to my wife you know when you and the baby when they when she the baby was
a baby you know what the first night it’s party time
the second time is the second night is always yeah okay it’s cool the turn not
the turn night I miss you the house is empty I know what to do is
the same thing like first time and be hotel it’s cool yeah I know the
traveling seems to be cool for most people and what you get when you get
used to it you know it’s it’s sometimes I like man
you just want to go home and you’ll be and your things enjoy your family but
still man I mean like I’m pretty sure that you’re gonna have this conversation
like hey sweetie where you want to go in a bowl let’s plan our vacation trip like
let’s go to Europe done that done that than that now I want to stay home and I
yes no but it’s like it looked very glamorous like it is it’s cool like I’ve
been to China I’ve never been to China and now I’m going to Milan Italy so it’s
like it’s crazy cool but I will be working a lot like when I was in Paris I
was there for seven days I think and I went out the first night mm-hmm
so like at the time of a dinner so maybe two three hours you know times to go to
the restaurant eat and get back so that’s it then I was in my room or at
the event all the time and only will you stop only one day I went out and it was
raining and snowing there like that was my day to visit otherwise I was working
editing practicing because when you’re over there you don’t have time to do the
other things it’s low it’s not work but you know time
to time you’re gonna learn how to get your you know your perk and being able
to enjoy a bit the place where you’re traveling and eventually min yeah yeah
like it’s a lot of work and like it at the beginning I think it’s super
stressful because it’s a lot of a new session and things like that so loud now
I’m going a Natalia f3 session would be going over there I don’t have any
meetups so it’s only those three sessions only one is new but I was
trying to do it earlier and it was failing so I’m trying to say like it’s
already like whoops like something is not working correctly so there’s work to
do the big challenge for me is I want to continue to stream and I want to
continue to do my YouTube video so like it means I need to carry a little bit
more tech and like that and like you know different time zone and things like
hopefully it won’t have them in the middle of the night or something like
that yeah figure out a way through maybe put things more simpler you know as
Jimmy’s a stream you don’t have to have that big life you know that you know
perfect background and your perfect setup just you know you know your your
coding you learning stuff you’re sure your knowledge and that’s it just yeah
yeah like the on the road setting you know like I don’t have the the fancy
background that man I just like that because it gives me more space to show
my screen nothing to be fancy just like I have more room to put stuff to share
that that’s why I’m using it the lights well you need lights because sometime
like it’s very dark in the room it’s pretty cool it like it’s cozy so when
you’re in the room for you for us it’s nice but to show you need lights so but
I found little lights and I bought myself where it is it’s over there
oh yeah but meaning lighter yeah yes I you did
an unboxing a couple months ago here with it yeah yeah and I bought myself
some reflector so it’s light it’s compact so I’ll be able to put the light
in the reflector so it will look like a bigger lamp mm-hmm because because I’m
wearing glasses lights it’s a little bit more complex otherwise I have a lot of
shadows and I look like I’m I have just like bad did you ever consider just not
showing your face just showing your screen and you know being just doing the
cold in there you know I don’t want to do that like for me if I’m doing it like
I mean I wanna I want that thing to be personal and it’s like I need to be in
the screen that’s why I’m also doing it on YouTube and it’s not the easiest part
like it would be way more easier just to share my screen and talk but if I want a
bid it’s not a relational it’s kind of a relationship I want to bond with the
people then I need to be there like you I cannot see all of you but if my face
is there then when you see me in an event like you would say oh like I know
this guy and you will come to see like there’s better chance you come to see me
or it will it will be someone not like just like a screen so that’s why I
understand what you mean but it’s still you know you can do this at home and you
know anyway you do whatever you want what everything I think the fact you
need like you have this slay this and you know that attack that tech that tech
to do your showing even that the fact that you want also do it like in it in
the perfect time zone you know uh yeah I have a question in the chat so
pic 91 817 entity framework and entity framework or apparently the difference
you could count them on the finger of the of one ends or maybe to like maybe
six or seven difference there’s a great podcast that was done by dud net rocks
and Julia gulia Lerman mhm about that that net she got a
lot of experience with entity framing she’s you know she did this she wrote a
couple books yeah a while ago yeah and in fact I I
did check her she she even had the entre site she had like I get started but I
couldn’t share our listen to that on my stream so that’s why I’m not doing that
but I will probably do that where is it which is a base G framework here oh can
I share my friend westward virtually his face she’s from the United States Jesus
yeah she’s based in Vermont okay so that’s the show they dude all the
difference the breaking changes like listening to that they convinced me you
know what like I should use entity framework or I know it will helps me
because a lot of time when I do and that’s why I was also using into the
framework back in the day is I wanted to do something and I didn’t want to spend
time managing the database and then blah blah blah blah so we’re just putting
entity framework you know and all that thing was careful for me
so apparently not a lot of the changes there’s breaking changes and honestly I
don’t know what it is I don’t like I don’t remember because I didn’t pay
attention of the Changez didn’t affect me it’s support
bunch of languages and it’s pretty cool and she has a plural site also and of
course she mentioned it Oh was it in the notes maybe I forgot I think that’s the one yep so that’s the
one also so I’ll have a look to those things the perfect the perfect gift for
your loved one yeah the perfect gift no but like a like
if he’s using already dotnet entity framework and you just want to know like
the difference that will definitely help him or help her I don’t know that that
will definitely helps let’s put it that way they talk about those things like in
the plural side course she explained things I quickly look at it but like I
said I since you need to pay for it I couldn’t share it but I think I will
download it and maybe watch it in the plane or something I think you can watch
it offline I need to install probably something on my laptop and I will be in
I don’t know how probably have a lot of stuff to do anyway in the plane so so
yeah so a lot of traveling but I’m really happy it’s really cool and it
gives me the opportunity to meet so many new developers and everything it’s
really cool oh ok so but that was nice but I was a little bit basic like it’s
more where to put what that I can understand it quickly okay let’s okay so this is a first Serie of sterile
different framework with SP net core yeah okay I catch that but okay let’s try that new example so let’s
open the terminal go up a little and now we’ll do a done it core with app oops
this okay now set up the eddard footer the
menu page layout do I really need that okay I need to change it for what a
space like that they change it they see three times there it is okay Dukey and after that delete the own
private simony and add the about student course and structure department so I’d
whoa add this cool how you working from home today pash index in passion decks replace the content of
the file with the following code replace the text Oh okay now I need to run it whip well I have a home page but it’s very
sad okay so now the NATO model following section
created at amount of the student can a number of course okay okay so now we
need to create different things so control this so now I need to create a
model folder I feel like I would like to add like another project called for
example data and put my poco class in there and now I need to create a student
so students or student student class and I will be a focal class so an idea last
name a first middle name enroll date a collection of enrollment enrollment
being going in a class right all right ID okay become the primary key of the
database that’s one thing that is cool a rambling geek how are you nice to see
you or to have you in it in the chat learning into the framework so the enrollment property is a
navigation property okay okay that’s cool that’s cool it’s funny how this one
is way more explain more stuff than the previous one I use entity framework long time ago
that’s what I was saying at the beginning maybe I don’t know not
twinning but maybe 15 or 10 years ago so I you know I I don’t want to pretend but
it’s kind of starting from scratch I remember I have some glimpse of what it
is I like works remember the poco class and some
relationship and stuff like that but I didn’t use it for a while and I want to
use it for my my project so I thought I will just messed around in like
following tutorial I found a really good story all I shared it in chat from Judy
Lerman on pleura site but it’s not public so I I cannot listen to it on
stream okay so now we need to create a new
model enrollment not yeah a new model so go there new class we’ll paste that and
I don’t like this so there’s a student are great in a
course okay okay so that’s the property and that
like when it’s like that this is all day oh no more music I want my music that’s
what they call the article that again navigation or something like that
navigation properties so those are navigation properties and those are like
the key okay so that’s why I can do drill down and that’s what go in the
database okay now I understand okay and great could be null because you may
have not finish yet the quarks okay so now let’s create course class and here of course ID a title some
credits and a collection of enrollments of enrolled minute yeah yeah okay okay I
agree and make sense I’m pretty happy about it so now in this section you use
this pinnacle scaffolding to generate an informal context last follow-up I didn’t
even add the context right I didn’t add it all maybe when I will add that table
it will do maybe when I add this thing so and three more content class the
content is in the main class and coordinate okay razor page Oh I will see like I was not sure at the
beginning if I was about to use the visual stole I did upgrade my visual
studio because initially I was like oh well do the visuals yo because back in
the day I was using visual studio and I remember you could right-click and it
generate your even your razor page and everything but then a lot of time and my
goal is to be as much as possible on the next side so I don’t want to get huge –
a tool that do things for me and then I go back on Linux and like losing that
tool so that’s why I’m you know doing it manually yeah so now razor page will
enter the create read update delete blob of the crud right okay that’s cool so
now run the following CLI to install the required NuGet package it’s it’s running
in like two databases why I don’t have an escrow server ah I’ll true the scaffolding see you
have a code generator apparently we’ll see okay so let’s let’s I don’t
like doing let’s do it one by one and let’s do it in a big
window I waited there on last week when I tried the the new URI tool that tool
is pretty cool it work my only problem when I was doing the so
URI is a command by a CMD that is very quiet and nice and light and whatever it
like in bed bunch of stuff better auto completion so if I type start typing now
I don’t know if you you notice but you know there’s completion already so I
could go there and I’ll come to so while I university so it’s pretty cool and now
if I do is s dear I think I could do as dear let’s say little bit fancy I thought you were
there maybe it was not you but yeah so pretty cool I was a insulin who
blogged about that and yeah I’ll to completion bunch of stuff bunch of – yeah that’s pretty nice so the net add
package is real light because we’ll be using SQL light so that’s nice now
apparently we mean the SQL server but just for the scaffolding part because we
don’t plan to use yet at least SQL Server that’s cool so now we’ll go
with the design that’s for the creation of the database tool I don’t know what
it is we didn’t add that previously I’m assuming it’s some library for the
scaffolding the code generator this is definitely the scaffolding thing it’s
adding a lot of in her project oops yeah I don’t need to do control shift no problem man see you another day REM
link I’m going on you’re closer to your time zone I’m going to Milan next week I
would be Mila in Italian so closer to your time zone so I will be it will be
super hard to stream even my like in my time slot anyway have a good have a good
one cool so now we have our other package
the microscope shows so okay that’s when I so now create a page student folder so
go here so now in page we need to create a new folder and we call that students students
voila now I’m assuming so run the following command to install
the ISP net code generator coupled scolding tool okay let’s clear that No
voila so the net tool again install global
dotnet ASP culture here cool so now it says to run this so dotnet SP net code generator razor
page model is student DC is the data context we did we create the data
context I don’t remember creating the data
context did we did I need it to start I thought yeah
something is missing like I could download it but I don’t see like I’m starting from scratch here
don’t create that we have project I’m pretty sure if I run the the command
will fail I don’t I don’t have at that time model right now I have models but I don’t have a data
context that’s what I mean see now it’s creating one update the
database context class let’s see what it does
but I’m pretty sure we’ll fail so that item context is contoso University that
school context so that doesn’t exist we didn’t create it it will fail you did
you DL I don’t know what it is was it explained nope update delete list let’s try it expecting some errors I
should have done like git or something would generating a new DB context class
oh that’s cool I like attempting to figuring out the entity framework
metadata for the model student well that’s pretty cool that’s a look I
should have done the they get thing just to see what’s new
yeah let’s do that I’ll maybe like maybe it’s too late yeah just whatever I won’t push it
I just want to track the changes so student-created White’s along its local so now here F bunch of god this is so
cool and now I have a data and have my
context that that I’m impressed like I really I was really expecting it to
crash though there’s like I need to okay but you know I think that’s what they
asked us to do after pretty cool pretty cool what else
Paige Paige Paige so data it create my school context where did he figure out
there was cool okay because we mention it here okay pretty cool put it deep cool so
database connection string I need to go in the change the connection chain to point a
to a SQL database name see you DB in the absence I’m assuming that’s pretty cool so now I need to
update the database context yeah because not a lot was there
excellent database context it’s here so now in this class I will need to add
some some some Samsung and it will be a DB set of type students and its students three time oh I didn’t put it at the good spot and put it here and I want this to be enrollment and
here it’s enrollments no course and courses voila well okay that’s the same
move it so now the override on model creation hey Kappa birdie hello yeah boy well for
me it’s been a while did you that’s so cool how did you do
that I like it with some glasses it’s not my original right does my
original has sunglasses no like how I like better yours cool I like it I like like my little cloud
points I need to add more stuff in it Iowa let me know like if anybody had
some thoughts about what could be interesting to buy with the cloud points
let me know I will do it I was just I don’t know I didn’t know what could be
interesting oh if I put override maybe it will help
me to have photo completion no to completion creating so now the anacott code creates division
entities you know that’s fine an empty set typically corresponds okay uh-huh
at the end that I said but prior to make the razor page but what’s this up to
table so it’s the mapping okay okay because I could say instead of students
say it’s young or something like that or like have TBL I used to work in a place
where every tea table was starting by TBL okay so that’s the mapping then like it on model creating on model protected Oh no I’m in the class no nothing to class
my bad my bad there it is there it is what it defined the names of the table
oh if I don’t specify them it will create an okay otherwise it will create
the table as students that’s what you mean
so by doing this now instead of having a table students will have a table student is it what they call the what’s the
naming him the flow or the something like that because I know back in the day
I was doing a lot of stuff in the poco class with annotation and I think now
it’s like it’s not cool anymore to do that so anyway following that 37 okay
start up a spinet core dependency injection service so yeah so I need to
go back and add that so Instituto code I need to go in the configuration services
so we’ll save this close it and I’ll go in the startup in the configuration
services here and we’ll need to add context it’s already there all right
ways ask a server so I’m assuming abisco server light yes
well light voila and connection string is good it
was these cool context so that’s still through yep so when that part was added
not sure was that the scaffolding probably the name of the king okay let’s cool create the database
update programs what would okay so instead of build run it build it
create and then run okay yeah it’s cool though I didn’t know but yeah mr. Lee so
like that’s why I wanted that was part of the reason I decided to go with
Visual Studio code is with Visual Studio IDE bunch of stuff happened and you
don’t know we called the scaffolding part installing it and everything so
that’s cool so now what I need to do here is just do the build and then that
will create a oast right though like this now oast run at the end right right now I will create a function
because that is defined here right yeah create DB if not exist excellent let’s do dads let’s whites
selecting it’s all funky I’m missing the closing curly brackets so what happened here oh and I forgot to record damn it ah last week I all on on twitch all my like
yeah oh the two episode I stream last week were partially muted you meet and
you mute because for some reason the music was tagged as third-party and they
had a claim I paid for my music so first of all well you know sorry talk to my
service say hey avid acclaim they told me Inc fix that with Twitter with twitch
so in which you can go and you click a you know I want to unmute my music my
video and they say like if there’s something you go in court in u.s. Oh
guess what the episode will stay mute so that’s why I will have no archive published this week on YouTube and I
taught myself well we’ll just record as I stream but I forgot to do it today so
look like my youtube channel won’t have a lot of update that’s good I know it’s
not good like I don’t like it but okay so what it’s doing
using the oast kata scope get the service provide provider then get the provider for this answer tides
create so ensure that is create okay cool so if
it’s an exception then log DB era okay hey Charl Sabu
how are you it’s nice to see you all might on my stream welcome you’re done
with the class no more school today excellent big day today or so in the
chat you could say hello to shabu it’s as real name is Charles and it’s my
nephew super happy to see him on the chat big shout-out to Charles I’m
learning a new framework to create database thanks copper birdie okay so now I have everything set up
except the database is empty so that’s why bla bla bla change model run the app
cool I’m sure in fact you all are nuts like me that’s why we hang out all
together I’ll be closer to you next week copper
birdie I’m going to a mullah it’s not close but it’s closer okay let’s let’s
run this this bad boy see how it’s going builder damn it
school context students that means that and my yeah and be cool I need to check the
weather over there because I’m pretty sure it’s different than here so now I forego in student yeah
let’s create one I should be getaway around pick a date that’s a nice type Picard makes you
super old cool nice my last university Meldrum start two
days ago oh did I miss something I should that’s what you mean like I
should have changed the the context instead and put student here your last University module you’re
you’re studying you’re doing some master or something right is it that the I
think you mentioned that on your stream yesterday MSC is it a master cool you’re
good man I’m impressed on my side last week I did a
certification so now I’m certified AZ 900 washer fundamentals that was a good
dance though a bunch of questions were tricky even if I do a lot of those
things like they got me thinking a lot my score was not perfect yeah smart
questions yeah it’s good I like it made it’s way better I did a long long
long time ago some kind of certification like the equivalent and they were asking
things about price and was like like no like make no sense now they are asking
more about a how the pricing will be working or things like that so it makes
sense and support and like so like it was really interesting
and it’s good like everything but basic fundamentals it was cool it was pretty
cool ok so now our seats that’s long but let’s data a DB initializer let’s
come here create a new file copy disks sorry and now this thing its populating our
database right so on initialize create be sure that the database exists fine
if there’s any okay okay so if there’s any students it won’t do anything so I’m
like right now there’s Charles in my database so if I run it will stay the
same if I’m not mistaken otherwise we’ll create a bunch of students and then for
each students we’ll add them oh that’s funny why do you do that this way anyway
we’ll add all them in our context save the chance changes then create a bunch
of course add them then match some okay and save the chains okay and when that
thing is called so since we move this there we could put
the – database initial are larger that’s nice any lash line ionizer there’s words
in English that are difficult to see initializer it’s hard so here that’s
better I like it better so no now they say delete but I don’t want to delete I
wanna see how it works so now I’m expecting nothing to happen let’s just
do a dotnet run here oh poor poor it’s my cone just just
running so now it’s running or is it where is it
I don’t see it Oh I closed it I should have okay so it’s only Charles
so now if I delete that great oh why did I close it again so now I want to stop
it and a wall to rerun yeah it’s working so now I created all the seeds because
cool and now if I go in details there’s nothing because we don’t show all the
information but there’s the the other things and since we don’t have anything
here nothing will happen that’s pretty cool that’s pretty cool it’s that’s
pretty cool that’s pretty pretty cool for old traffic situation preparedness
English will I traffic’s for Allah and the following code the passing keyword oh cool that’s nice I like it yeah will
I be able to start messing around in the Blazer I think I will need to have I
think this is close like sinks I was in the razor page it’s
good because last time I was using entity framework was with MVC so now I
understand better the structure of the project here who Weaver I think I would
definitely prefer having instead of having a folder data having a data
project and know it yeah data project where my domain will be and like all the
classes my model will be in a project data or something like that or maybe I’m
over architecting I don’t want to I don’t make the project bigger and I it
should be but I think doing that with our project though not sure what will he
like that thing will become like if I want to
do it and let’s say we wanna yeah like whoa
we’ll do everything separated so if we want it for example do it could be cool
I have one of my friends he’s doing a lot of examiner and so that could be
cool once we could create examine app to connect to it and different things so if
we are having all the data model and all the context separated will be easier
that way to implement multiple interfaces so I think I will do that I
just need to make sure like it’s the good way so yeah so I think next week we
will quickly clean up use your vote because I mentioned at the beginning I
screw up when I was trying to move things around so we’ll just clean it up
and I think we’ll create a new project nothing like I will create the structure
solution with three project or me before adding your name test while we don’t
have anything yeah I think it’s it will be better like we’ll be like more
professional more best practices startup what do you think what do you think in
the chat I think I like it so now how about any suggestion for a for raid
who’s who’s dreaming stay with me stay with me
so streaming so oh we have potato quality I read the
other day that the other time I was cool I’ve also lucky nose I think it’s that
7-eleven seven something like that no animal s living I don’t know that his
living what he’s doing so let’s try to go okay excellent that’s the one I was
thinking also so we’ll go there I don’t know why it’s not showing in my
dashboard it’s just adding it boom excellent so guys it was awesome thank
you I will put a new page here just like that roll the credits there it is Danny
so again thank you for following it was nice having you all learning entity
framework I think it was very profitable I’m really happy I spent the time to
play around before jumping and messing around in our project so having like a
empty project and just learning it was I think very cool so thank you for being
way with me was very appreciated with your help
hello again Charles Cooper birdie see you soon and yeah otherwise see you on
Friday b’bye

No Comments

Leave a Reply