ASP.NET Core Web API .NET 6 2022 - 4. Installing Entity Framework

  Рет қаралды 110,942

Teddy Smith

Teddy Smith

Күн бұрын

Пікірлер: 242
@mbulelo-damba
@mbulelo-damba 2 жыл бұрын
When I ran the Add-Migration InitialCreate command I got an error. I installed the Microsoft.EntityFrameworkCore and the Microsoft.EntityFrameworkCore.Tools nuggets and everything work. You forgot to install those two. All in all the nuggets I have are : Microsoft.EntityFrameworkCore Microsoft.EntityFrameworkCore.Design Microsoft.EntityFrameworkCore.SqlServer Microsoft.EntityFrameworkCore.Tools Swashbuckle.AspNetCore
@jeremybrews2521
@jeremybrews2521 2 жыл бұрын
Thank you this helped alot
@glmarc7833
@glmarc7833 Жыл бұрын
Thx friend, if u don't add this packages u can't seed the database!!!!!
@anasofialeitao3989
@anasofialeitao3989 Жыл бұрын
this saved me thank you
@fernandomarcel1996
@fernandomarcel1996 Жыл бұрын
gracias amigo!! me ayudaste aquí
@Console.WriteLine
@Console.WriteLine Жыл бұрын
THANKS!!!
@raggardy
@raggardy Жыл бұрын
Lol.......I remember watching this a year ago and thinking "WTF, how am I ever gonna learn this?". Now, I've just popped back to recap on fluent api many to manys. You're a star, Teddy and to anyone else thinking "How the f**k am I gonna learn this?", you WILL understand it. Just keep practicing under the guidance of Don Ted ;)
@ernest1428
@ernest1428 Жыл бұрын
Beginner here, and I am completely lost, lets see how it goes in one year from now haha
@nikolar5847
@nikolar5847 9 ай бұрын
So, how's going?@@ernest1428
@ronjohnson123
@ronjohnson123 9 ай бұрын
@@ernest1428 its been 6 months, hows it going?
@ernest1428
@ernest1428 9 ай бұрын
@@ronjohnson123 I have stopped my studies due to personal reasons, but I finished some courses and reached some SQL queries with .NET, yet I'm planning on continuing next year the journey
@raiminjshh
@raiminjshh 7 ай бұрын
@@ronjohnson123 dude gave up
@tebogolem5456
@tebogolem5456 2 жыл бұрын
This was super helpful. I was searching for over 2 days and here's everything I wanted
@phungquanglong1446
@phungquanglong1446 Жыл бұрын
OMG Your tips to the databases (connection string) was so amazing. Love you good works, thank you!
@witChaos
@witChaos Жыл бұрын
this is the best tutorial I've found so far. As another said this is enterprise level and cover a lot of topics. Nice
@aisyahh38
@aisyahh38 Жыл бұрын
Hello Teddy, I really appreciate your effort making these tutorial videos. Your steps really clear and easy to understand. Thank you very much!
@racmanov
@racmanov 9 ай бұрын
Pokemon is already plural. SInce (from my long term memory) it actualy stands for Pocket monsters
@hanchen8106
@hanchen8106 Жыл бұрын
For anyone unable to add the SQL server in Visual Studio with an error that says cannot connect or find the SQL server, your connection name may not be the same as the Name in the property window. Instead, click on the "View Connection Properties" in the Server Properties window, and copy the server name instead. Put that in the "Server name" in the connect window in VS
@saahilsankarb4930
@saahilsankarb4930 11 ай бұрын
Thank you, this was so helpful for me. I was facing the same issue and searching for the solution in stackoverflow and all but I couldn't find it. Finally I just went down to the comments and lo and behold! The answer was right there!
@lucianasuciu4798
@lucianasuciu4798 Жыл бұрын
love your videos! they are very good for begginers ! Thank you so much for this ! 🥰😍
@rotface6969
@rotface6969 2 ай бұрын
For those of you watching who might have trouble hooking up your local server or logging into your local server you have to set "Trust Server Certificate" to "True" when prompted.
@waynehamberg9248
@waynehamberg9248 4 ай бұрын
Tried running this in .Net 8 but built it using .Net 6. All those warnings you got don't work when you get to a an error in Program line where it's trying to run data. Null exception because all those warnings you have in your classes.
@dataStream2
@dataStream2 Жыл бұрын
Guys if you have a problem with your Add-Migration and nothing helps, make sure you delete the stuff in your Controllers folder in solution explorer. I forgot to delete the WeatherForecast default app controller and it messed up my build
@fercho1463
@fercho1463 3 ай бұрын
Un exito mi amigo Teddy, por favor trata de hacer una aplicacion conjunta de Angular y webApi .netCore, una bien avanzada, como tu sabes! gracias amigo por todo el trabajo que nos brindas. Saludos desde Argentina!
@call_me_cat1709
@call_me_cat1709 Жыл бұрын
I dont know if the course has been updated, but the seed columns doesn't match with de models. Informations such as Rating, FirstName, Last name in Owner and Review does not exist. I checked the UML twice and still, seeds does not match.
@Ali-vj8hs
@Ali-vj8hs 8 ай бұрын
facing same problem
@Yagoonerz
@Yagoonerz 7 ай бұрын
He updated it. If you check his Github models file you can see the corrected models. only need to change review and owner models slightly
@mouhssinsouici9290
@mouhssinsouici9290 10 ай бұрын
Thank you.. i like this tutorial, actually i'm using as a project for school. just wanna add that there is an easier (for me) way to get the connection string, need just to execute this script >> select 'data source=' + @@servername + ';initial catalog=' + db_name() + case type_desc when 'WINDOWS_LOGIN' then ';trusted_connection=true' else ';user id=' + suser_name() + ';password=' end as ConnectionString from sys.server_principals where name = suser_name()
@afaqahmed7325
@afaqahmed7325 Жыл бұрын
Thank you for such a cool tutorial. Keep it up🤓👍
@redlamaravind104
@redlamaravind104 3 ай бұрын
Although tabels are created when migrating, How the data is injected to database??, do we previously added in db?? can anyone explain me pls
@stavrostsirlidis3921
@stavrostsirlidis3921 Жыл бұрын
Awsome! thx for this! You are great!
@dredivany3019
@dredivany3019 11 күн бұрын
I know this is code-first approach, but is there a way we can automate these with command line prompt? Im an idiot so I don't understand anything but copy and paste
@sdscode
@sdscode Жыл бұрын
To seed data from the command line: `dotnet run seeddata`
@daniab2013
@daniab2013 10 ай бұрын
You are perfect! Thank you so much!
@deepakrevidagar4275
@deepakrevidagar4275 Жыл бұрын
Teddy I have gone through this entire video series and now I am applying that to another project but I stuck In seed file creation. which you have missed although I have tried several ways to create it and created also and when I am done with it is showing tons of error while running the "dotnet run seeddata" command......... please help me
@TeddySmithDev
@TeddySmithDev Жыл бұрын
what are the errors? please post github link and I will look
@angus1111
@angus1111 Жыл бұрын
Really really useful! Thanks !
@MikeKm-hd1ve
@MikeKm-hd1ve 5 ай бұрын
Hey, is there a way to manually execute the sql queries instead of using the dbcontext models?
@DenisDutu-b1u
@DenisDutu-b1u Жыл бұрын
If you use an local server like he does you can only type "." (a dot without the strings) insteat of copying the whole name
@marypaul9627
@marypaul9627 Жыл бұрын
Excellent!new subscriber here
@maaz6912
@maaz6912 Жыл бұрын
Hello teddy. I am getting the tables but there's no data inside. Every command got executed without any errors. Can you give me a clue as to what might have happened?
@almoniaruela.8241
@almoniaruela.8241 Жыл бұрын
Hello, what is the alternative way if I dont use the Add-Migration? In our task, they say that we need to avoid code first approach with migration.
@darkoplax7688
@darkoplax7688 9 ай бұрын
can i do this without downloading microsoft SQL ? like doesnt VS have its built in SQL and I have MySQL on my pc as well ?
@SS-uf4uq
@SS-uf4uq 2 жыл бұрын
i have a proplem, after doing all the steps well, and after updating the database i fount it generate automatically a column with name OwnerId1 in PokemonOwners table, and a column with name CategoryId1 in PokemonCategory table, and i notice that while adding migration the program tell me that it create those 3 columns in the shadow, i don't know the reason, please could you help me with that!
@Nex7sYv
@Nex7sYv Жыл бұрын
Question, is there a way to avoid all this DB creation by sharing a database? it is not easier to share a file of a database?
@sylgeek1303
@sylgeek1303 2 жыл бұрын
Is onModelcreating method for many to many relationship only?
@TeddySmithDev
@TeddySmithDev 2 жыл бұрын
It's for many things in general, but many to many relationships is one of them
@adamclarke774
@adamclarke774 2 жыл бұрын
Ahh i was loving these tutorials until this video, code in db context is still a mystery but also theres additional stuff in the seed data that wasnt in the initial models! There was no Rating in Reviews, or firstname lastname in owner etc :(
@thetechchronicles
@thetechchronicles 2 жыл бұрын
You could tweak the file acc to your requirements. Maybe use something like this: new PokemonOwner() { Pokemon = new Pokemon() { Name = "Pikachu", BirthDate = new DateTime(1903,1,1), PokemonCategories = new List() { new PokemonCategory { Category = new Category() { Name = "Electric"}} }, Reviews = new List() { new Review { Title="Pikachu",Text = "Pickahu is the best pokemon, because it is electric", Reviewer = new Reviewer(){ FirstName = "Teddy", LastName = "Smith" } }, new Review { Title="Pikachu", Text = "Pickachu is the best a killing rocks", Reviewer = new Reviewer(){ FirstName = "Taylor", LastName = "Jones" } }, new Review { Title="Pikachu",Text = "Pickchu, pickachu, pikachu", Reviewer = new Reviewer(){ FirstName = "Jessica", LastName = "McGregor" } }, } }, Owner = new Owner() { Name = "Jack", Gym = "Brocks Gym", Country = new Country() { Name = "Kanto" } } }
@VukotaDjLewu95
@VukotaDjLewu95 2 жыл бұрын
Just edit your Reviews and Owner classes. Instead of Name, set FirstName and add one more line for LastName, like this: public string FirstName { get; set; } //Owner.cs public string LastName { get; set; } //Owner.cs and for Review class, just add this: public int Rating { get; set; } //Review.cs After that, you will be able to work without errors! 🙌🏾
@TrashCanSystem
@TrashCanSystem Жыл бұрын
@@VukotaDjLewu95 thank you mate, saved me here. teddy smith sometimes leaves things very disconnected, i gave up on his tutorials many times before
@brianjamesgresos2320
@brianjamesgresos2320 Жыл бұрын
Are you using SQL Express Core?
@addybeez3277
@addybeez3277 Жыл бұрын
When you create Rating filed ,it's gave me error
@almoniaruela.8241
@almoniaruela.8241 Жыл бұрын
Just add public int Rating { get; set; } in Review class
@joeyestrada9071
@joeyestrada9071 Жыл бұрын
Man, I'm getting an error on this last step. Does anyone know how to fix it?
@LukasSoftwareDeveloper
@LukasSoftwareDeveloper Жыл бұрын
Maybe you will know the problem. I use AzureSQL and when I try to execute migrate I receive error: The SELECT permission was denied on the object '__EFMigrationsHistory', database 'master', schema 'dbo'. Currently still figuring out how to grant access to master. But still no hope.
@LukasSoftwareDeveloper
@LukasSoftwareDeveloper Жыл бұрын
forgot to include category in defaultconnection heh. (dont use default aka master).
@TeddySmithDev
@TeddySmithDev Жыл бұрын
You will prob have to go in and set the permissions in SQL
@LukasSoftwareDeveloper
@LukasSoftwareDeveloper Жыл бұрын
@@TeddySmithDev Thank you for response, anyway, I just used default connection instead what I needed to do was define Catalog. When I defined Catalog= it worked fluently. Thank you for response.
@opomomlslsa9164
@opomomlslsa9164 Жыл бұрын
why we need that seed class plz someone explain how it works? do I need to do the same for my own projects?
@Mark-nm9sm
@Mark-nm9sm Жыл бұрын
seed class is used to populate dummy data for your project. You dont really need it but if you want to test your API out then this is one way you could create ''random'' test data :)
@quanhong8967
@quanhong8967 Жыл бұрын
sorry i coppy code file Seed.cs but it error with "review"
@renanwerly3692
@renanwerly3692 Жыл бұрын
I've created the database and the seed as you shown. When I try to select the rows, the datas that should be there(seed), they're not :(
@TeddySmithDev
@TeddySmithDev Жыл бұрын
does it produce error? your database context or settings .cs file is likely culprit
@renanwerly3692
@renanwerly3692 Жыл бұрын
@@TeddySmithDev don't worry, I rebuilt everything from zero and it worked! Thank you, you're Awelsome!
@bolisboktor96
@bolisboktor96 Жыл бұрын
don't forget to run the seeding commands from the terminal cuz I did and thought they ran automatically when u add migration and update the database
@Kalliskivi63
@Kalliskivi63 11 ай бұрын
what is this "seed" use for ? i trying create different theme "not pokemon" but im stuck here idk what is that seed
@TeddySmithDev
@TeddySmithDev 11 ай бұрын
Seed = put fake data into DB so you can have something to work with
@Kalliskivi63
@Kalliskivi63 11 ай бұрын
@@TeddySmithDev i see, so i can skip that step right?
@sakkesuominen516
@sakkesuominen516 2 жыл бұрын
Are the SQL server and SSMS required? Any tips for mac users?
@TeddySmithDev
@TeddySmithDev 2 жыл бұрын
You can use Azure Data Studio with a docker instance. It works almost exactly the same.
@ngocanh9250
@ngocanh9250 Жыл бұрын
Did you change the Model??? The seed was error
@dariamask-hv9bu
@dariamask-hv9bu 6 ай бұрын
I have the same. How did you solve the problem?
@damanm4146
@damanm4146 Жыл бұрын
21:00
@nazar87ali
@nazar87ali 2 жыл бұрын
thank for this tutorial but where another videos ??
@TeddySmithDev
@TeddySmithDev 2 жыл бұрын
I put them out one at a time so not to burnout subscribers. Should have one out a day or every other day at least.
@anionzo
@anionzo 9 ай бұрын
dotnet run seeddata
@АрнольдАйзкалнс
@АрнольдАйзкалнс Жыл бұрын
Add migrations errors, update errors, seed errors... nice course :(
@stoppy4
@stoppy4 11 ай бұрын
Add-Migration succeeded for me, but with some warnings: The foreign key property 'PokemonCategory.CategoryId1' was created in shadow state because a conflicting property with the simple name 'CategoryId' exists in the entity type, but is either not mapped, is already used for another relationship, or is incompatible with the associated primary key type. Same goes with PokemonOwner.OwnerId1 Anyone with the same issue?
@TeddySmithDev
@TeddySmithDev 11 ай бұрын
Could be many reasons but most common is that EF is not picking up the relationships and is trying to create them on the fly.
@KrisztianVarga1993
@KrisztianVarga1993 2 жыл бұрын
If for whatever reason connecting to the server doesn't work, Try this: (localdb)\MSSQLLocalDb
@Kyrathos
@Kyrathos Жыл бұрын
Man, i hate it when people say "just copy paste it" without at least explaining it a little bit. Lets stick to the most important error for this: the seed from the github repo is the FINISHED seed of the project (i assume), which is incompatable with the current status of the project (e.g. reviews suddenly have ratings, owners have first and last names etc). If some1 has trouble with it, either remove incompatabilities from the seed code or add those to the models.
@zulfikarditya7142
@zulfikarditya7142 8 ай бұрын
agreed
@nareshkumarmm6244
@nareshkumarmm6244 8 ай бұрын
I agree with that, little bit disappointed as I came for an explanation
@alimalikashraf7623
@alimalikashraf7623 7 ай бұрын
yh really poor tutorial tbh. Hes just writing the code and hardly explaining it.
@andriitest8015
@andriitest8015 5 ай бұрын
thanks
@damirparipovic5179
@damirparipovic5179 3 ай бұрын
Thank you for this comment. I thought I was going crazy. Updated the models and redid the migration steps. Got it to work :)
@SnippetSurfer
@SnippetSurfer 2 жыл бұрын
Your tutorials are really enterprise level, most other content creators don't do this on this level, they'll just give it from a locally perspective, I bet you get into design patterns too 🔥
@deepazure
@deepazure Жыл бұрын
Dude.. the SQL Server Object Explorer, total diamond right there. Love the tip!
@ulvinasibli
@ulvinasibli 6 ай бұрын
It is just a coding session for himself without explaining things, started to become annoying after 4th video..
@mitulgupta6164
@mitulgupta6164 Жыл бұрын
If facing an error during Add-Migration InitialCreate with build failed then do some changes owner(first name and last name instead of just name ) and review (add ratings)class
@nareshkumarmm6244
@nareshkumarmm6244 8 ай бұрын
I get this error -> The property or navigation 'Category' cannot be added to the entity type 'PokemonCategory' because a property or navigation with the same name already exists on entity type 'PokemonCategory'.
@gio-iova
@gio-iova 6 ай бұрын
thanks a lot,i have not noticed changes in review :)
@theroostingroaster1584
@theroostingroaster1584 Жыл бұрын
When I copied the seed file from your github I was getting red squiglies under rating for reviews and FirstName and LastName, I don't remember you adding them to the models. Or does this have something to do with the relationships. Maybe I messed up there. IF someone had a similar issue would appreciate any help.
@Nex7sYv
@Nex7sYv Жыл бұрын
same here, owner does not have first and last name
@spencersedano
@spencersedano 8 ай бұрын
If you get an error after doing everything correct, in .csproj file of your project, change the InvariantGlobalization to false
@Manuel_Roos
@Manuel_Roos 7 ай бұрын
Thank you. It was bugging me
@Mooseontheloose89
@Mooseontheloose89 11 ай бұрын
Decided to load my data directly into the database before starting the application build, SQL is easy and it's so much easier to do this at database level rather than scripting something into the application. But good to see that you've used a different way which will help people who lack SQL skills!
@kirillzlobin7135
@kirillzlobin7135 7 ай бұрын
1:03 Create DB 2:00 Get a connection string 24:11 Finally someone showed me how to find terminal in Visual Studio :)
@franciscoseverino1851
@franciscoseverino1851 2 жыл бұрын
it works, I had some issues when running the Add-migration InitialCreate command -- after googling I found that I had the connection string spell wrong, but I made it . I proud of myself. Thanks for watching hahaha- like teddy said
@TeddySmithDev
@TeddySmithDev 2 жыл бұрын
Thanks for watching 😂
@nettech4939
@nettech4939 11 ай бұрын
This is the best explanation of EF core that I have ever seen. Thank you!
@trashbin2166
@trashbin2166 Жыл бұрын
Teddy, thank you man! You have no idea how helpful I'm finding your content to be!
@nickben8668
@nickben8668 2 ай бұрын
You don't really have to write all the code in the OnModelCreating-method. EntityFramework is intelligent enough to relate the objects just by the references you are making in the classes. I do get that its nice to know what is happening, but if it's not discribed in more detail, people are most likely just copy-pasting anyway. So for all beginners, you can leave that method empty.
@NastyManny
@NastyManny 23 күн бұрын
If ur watching this in 2024, you don't have to use modelbuilder anymore because after EntityFramework 5 it map the database only using the model classes
@daukaevk
@daukaevk 6 ай бұрын
Thank you so much for connection string trick
@helinkaya8620
@helinkaya8620 Жыл бұрын
When i run "Update-Database" command I got an error:The ConnectionString property has not been initialized. why is this error caused, how can i fix it.
@alib1430
@alib1430 Жыл бұрын
Did you fixed it i have the same error and if you did could you explain me too please
@interceptionunit6666
@interceptionunit6666 Жыл бұрын
same error
@codejunkie3531
@codejunkie3531 Жыл бұрын
if you did it teddy´s way, so make sure you reference the correct key from appsettings.json in your programs.cs. "DefaultConnection" is the key with your ConnectionString, so check options.UseSqlServer(builder.Configuration.GetConnectionString("DefaultConnection")) is correct. could be a typo or your autocomplete, messing with you.
@elchinmirzayev7631
@elchinmirzayev7631 4 ай бұрын
thank you for like perfect example, because I search what type project can i write, but in the the create seed, I don't understand why you need it? without it isn't good? we can't write different without seed?
@Console.WriteLine
@Console.WriteLine Жыл бұрын
I've spent weeks trying to watch how to connect to database... and everywhere i was getting some kind of error. but with you it was so easy!
@SUMITKUMARKAMTI-t7i
@SUMITKUMARKAMTI-t7i 5 ай бұрын
sucessfully i am able to run my project but data is not get inserted in any table what could be reason for this can anyone please tell me
@RonGrethel
@RonGrethel 2 ай бұрын
O dude that simplifed connecting the sql server thank you for that.
@tallerdx4020
@tallerdx4020 Ай бұрын
Hey you skipped form adding DbContext to Migrations dont get it
@jamesbuntin-m5x
@jamesbuntin-m5x 5 ай бұрын
i cant find the second Pokemonrevapp foulder it just has the initial one
@guntza22
@guntza22 2 жыл бұрын
I have issue when I run command dotnet run seeddata then it throw "System.ArgumentOutOfRangeException: startIndex cannot be larger than length of string." I don't know why. I try to repeat to see video and follow the code but not work. I still error when seed data. I can migration and update to database success
@edrismoavenghafouri
@edrismoavenghafouri Жыл бұрын
make sure you add the "builder.Services.AddTransient();"
@bakhtiarhussain3404
@bakhtiarhussain3404 Жыл бұрын
Data not seeded Idk why
@yasoobrizvi2706
@yasoobrizvi2706 Жыл бұрын
same here
@_vermeulen_musaddiq_
@_vermeulen_musaddiq_ Жыл бұрын
same here
@theroostingroaster1584
@theroostingroaster1584 Жыл бұрын
hey did you find a fix to why your data didn't seed ?
@ahmedsamiirr20
@ahmedsamiirr20 Жыл бұрын
sammmmmme
@hafidazer1634
@hafidazer1634 8 ай бұрын
Damn thank you Teddy nice video, but I did use the azure sql database and worked perfectly 🤣
@TeddySmithDev
@TeddySmithDev 8 ай бұрын
🙌
@nareshkumarmm6244
@nareshkumarmm6244 8 ай бұрын
I get this error -> The property or navigation 'Category' cannot be added to the entity type 'PokemonCategory' because a property or navigation with the same name already exists on entity type 'PokemonCategory'.
@TeddySmithDev
@TeddySmithDev 8 ай бұрын
You may have added the same property to the model
@HT-go2nb
@HT-go2nb 8 ай бұрын
How do i do this in VS Code? 2:45
@jeffqseid2169
@jeffqseid2169 Жыл бұрын
When i run "Update-Database", only the table names (without the data) is being stored at default database named "main". Does it because i didnt follow your database name which i opted to name it as pokemonDB?
@lightlysal
@lightlysal Жыл бұрын
No, you can name your database whatever you like. Chances are you missed the step at 3:34 where you type the server name at the top and then *choose from the Database Name field at the bottom.* From the SQL Server Object Explorer you can probably delete your "main" database and then restart from 2:45
@nebilimbe
@nebilimbe 11 ай бұрын
did you add Services.AddTransient(); in program.cs file? i forgot, I encountered the same error.Then I ran the dotnet run seeddata command.
@Limitlesss06
@Limitlesss06 9 ай бұрын
hey teddy i have been getting nullrefernceexception everywhere like in models where we set the firstname lastname etc
@aymansanusi3510
@aymansanusi3510 2 ай бұрын
Bro how did you get that connection string from the search bar?
@gaikwadpremkumar5830
@gaikwadpremkumar5830 2 ай бұрын
Search box.
@HungTranCR3
@HungTranCR3 8 ай бұрын
24:24 d
@Manuel_Roos
@Manuel_Roos 7 ай бұрын
I had my troubles with the Rating in the Seed file, but I managed to put it in the PokemonReview model class. Nice little test you put in there
@nikhilitty
@nikhilitty Жыл бұрын
If you're using docker for whatever reason, your connection string may have the password show up as a bunch of *****. Just put in your actual password, should work out fine(if you've followed everything else properly that is).
@cryptoeric24
@cryptoeric24 Жыл бұрын
Any advice to connect visual studio to sql server running in docker. The sql server object explorer doesn't work and google replies suck
@SweepAndZone
@SweepAndZone 6 ай бұрын
So I got everything going good, the only issue I have is that the data is not showing up in the actual local SQL database? I tried to run another Database-Update and it even said No migrations were applied. The database is already up to date. But then I check my database and there isnt anything there?
@TeddySmithDev
@TeddySmithDev 6 ай бұрын
Make sure you are not checking the “master” db when checking database.
@thomasmoncrief26
@thomasmoncrief26 22 күн бұрын
I had to add "Database = PokemonReview" as a parameter in my connection string, then it got created in the right place. Not sure how I missed copying the right string.
@sahithshetty1035
@sahithshetty1035 Жыл бұрын
Didn't anyone get errors in the seed file. In the seed file provided in teddy's github link, there are firstname and lastname in the owner. But while creating the owner modal, we didnt include them. Did anyone did something about this?
@MrChubib0
@MrChubib0 Жыл бұрын
Yeah you need to change the Name to FirstName and LastName
@Michael-wi2ee
@Michael-wi2ee Жыл бұрын
Yeah you need to change it. And update the Review aswell. He integrated a public int Rating
@Console.WriteLine
@Console.WriteLine Жыл бұрын
Thanks guys ^
@dinamohamed13600
@dinamohamed13600 11 ай бұрын
I had no errors but still the database didn't created
@TeddySmithDev
@TeddySmithDev 11 ай бұрын
You might need to add EF core to program.cs
@ziadmoghazy6689
@ziadmoghazy6689 Жыл бұрын
I'm hoping someone sees this but my build fails when i try to Add-migration i tried using -v but that didn't give me any useful info as to why it's failing
@manuelbacallao1965
@manuelbacallao1965 2 ай бұрын
Dude the connection string thing was massive. Love your channel bro. Keep it up.
@kiran8082
@kiran8082 8 ай бұрын
I am gtting error while adding migration itself, tried hard but couldnt find solution.....
@wisedragon4883
@wisedragon4883 Жыл бұрын
I have right columns in database, however there is no data. In the table Countries I have only empty columns Id and Name. How can I fix this?
@christiancaliendo6875
@christiancaliendo6875 6 ай бұрын
I tried making my own database design but I keep getting errors because i cant put Null values into the table
@TeddySmithDev
@TeddySmithDev 6 ай бұрын
please share error
@christiancaliendo6875
@christiancaliendo6875 6 ай бұрын
Well i solved it by just adding a question mark after variable initializers like int -> int?@@TeddySmithDev
@itsrino9851
@itsrino9851 9 ай бұрын
"you probably didn't need to know that" .... I did, i did need to know that. lol
@sdscode
@sdscode Жыл бұрын
In this specific scenario, what would be the best way to add additional restrictions to fields? for instance, Max Limit of character of the Country, or the Review integer can only be from 1 to 5?
@umidkurbanov5495
@umidkurbanov5495 Жыл бұрын
18:57 how come you have "Migrtations" folder out of nowhere?
@weston4412
@weston4412 2 жыл бұрын
I use microsoft sql server at my company, I will back up that claim. Good to know it.
@PrajwalYeotkar
@PrajwalYeotkar Жыл бұрын
For me the ServerName was not same as the Name in the Server Properties, It was in View connection properties where its clearly mentioned ServerName might help someone
@kamilmikua5794
@kamilmikua5794 Жыл бұрын
nice way to get a connection string! But there is simpler way. We can simply connect to server and choose database with connection string from C# level. Anyway Loved your content, Have a nice day good man
@Cursix
@Cursix 2 жыл бұрын
Teddy i followed ur video and everthing work perfectly but i forgot to add 1model to add 1 more model to the database do i need just update databas? Or add migration again?
@TeddySmithDev
@TeddySmithDev 2 жыл бұрын
Both. Run migration and update database in that order.
@jorgitorial
@jorgitorial Жыл бұрын
Man! Binge watching (and coding along!) your content. Simply amazing!!!
@donydp
@donydp Жыл бұрын
Thanks Prof
ASP.NET Core Web API - 6. GET & Read Methods [PART 1]
36:24
Teddy Smith
Рет қаралды 62 М.
Офицер, я всё объясню
01:00
История одного вокалиста
Рет қаралды 3,5 МЛН
Brawl Stars Edit😈📕
00:15
Kan Andrey
Рет қаралды 56 МЛН
АЗАРТНИК 4 |СЕЗОН 3 Серия
30:50
Inter Production
Рет қаралды 1 МЛН
Players vs Corner Flags 🤯
00:28
LE FOOT EN VIDÉO
Рет қаралды 69 МЛН
Don't Use Polly in .NET Directly. Use this instead!
14:58
Nick Chapsas
Рет қаралды 63 М.
Brutally honest advice for new .NET Web Developers
7:19
Ed Andersen
Рет қаралды 197 М.
The Logging Everyone Should Be Using in .NET
15:34
Nick Chapsas
Рет қаралды 70 М.
The Free Way to Create Awesome PDFs in .NET
12:45
Nick Chapsas
Рет қаралды 47 М.
Apple Silicon and .Net Devs BIGGEST struggle, SOLVED!
14:29
Alex Ziskind
Рет қаралды 30 М.
DHH discusses SQLite (and Stoicism)
54:00
Aaron Francis
Рет қаралды 74 М.
ASP.NET Core Web API - 10. POST & Create Methods [PART 2]
35:32
Teddy Smith
Рет қаралды 29 М.
The Home Server I've Been Wanting
18:14
Hardware Haven
Рет қаралды 145 М.
Офицер, я всё объясню
01:00
История одного вокалиста
Рет қаралды 3,5 МЛН