12. Adding your DbContext file | ASP.NET MVC

12. Adding your DbContext file | ASP.NET MVC

Ervis Trupja

3 года назад

57,523 Просмотров

📌 Course link: https://bit.ly/3CWvkqk
📌 Source code: https://bit.ly/3jvocZK
------------------------------------------------------------------
The DbContext file is also known as the translator file between the Models (C# classes) and the data storage (SQL in our case).

You can create your custom DbContext by inheriting from the DbContext base class and configure your class to be used to translate C# code into SQL and vice versa.

===================================
You can also watch my courses on:
🎯 Udemy: http://bit.ly/2MaEA5r​​​​​​​​​​
🎯 LinkedIn Learning: https://bit.ly/2NJ5PEF​​​​​​​​​​
🎯 Pluralsight: http://bit.ly/2EsgjlJ​​​​​​​​​​
===================================

#mvc #aspnetcore #csharp

Тэги:

#asp.net_core_mvc_-_complete_application #mvc_project_in_asp.net_c#_step_by_step #complete_mvc_project_with_entity_framework_core #adding_your_first_model #complete_mvc_app_step_by_step #learn_asp.net_mvc #ecommerce_mvc_c# #ecommerce_mvc_project #learn_asp.net_mvc_5_-_complete_tutorial #dbcontext_in_entity_framework #dbcontext_.net_core #asp.net_dbcontext #dbcontextoptionsbuilder_example
Ссылки и html тэги не поддерживаются


Комментарии:

Sri Kanna
Sri Kanna - 04.10.2023 08:52

Hi , I am getting error while installing Microsoft entity framework. Could you please help me on it. error : Installing 'Microsoft.EntityFrameworkCore' failed Additional info: Package restore failed. Rolling back package changes.

Ответить
Hanane Raib
Hanane Raib - 03.09.2023 17:50

I can't see the startup.cs file in my project ?? what should I do in this case

Ответить
dng
dng - 28.08.2023 16:12

builder.Services.AddDbContext<AppDbContext>(); (.net 6)

Ответить
Satyajit Dandi
Satyajit Dandi - 08.08.2023 18:14

As you instructed in my project there is no such file created as startup.cs to configure dbcontext!! what should i do ?? Instead I have program.cs file.

Ответить
Minh Cao
Minh Cao - 18.07.2023 12:05

Sorry, I am beginner and I want to build lines 2,3,4,5 like the video. Thanks

Ответить
Claudio Torres
Claudio Torres - 10.07.2023 19:20

which version of .NET are you using?

Ответить
Arkadius Ega
Arkadius Ega - 28.06.2023 17:42

Where is link download the Database?

Ответить
Shravan Devadiga
Shravan Devadiga - 27.06.2023 22:38

but where in program.cs ,,,, like above which line or code as you said AddControllerWithView();

Ответить
Mrunmayee bangar
Mrunmayee bangar - 22.03.2023 16:28

There is no startup class in . Net 7...
What should I do?

Ответить
Nhlonipho Xaba
Nhlonipho Xaba - 03.03.2023 17:40

There's not Startup Class in .NET 6, what I should do

Ответить
Chiến Nguyễn
Chiến Nguyễn - 28.02.2023 10:21

with versions from 6. we add
builder.Services.AddDbContext<AppDbContext>();
at the program.cs

Ответить
John Patrick Haguimit
John Patrick Haguimit - 11.02.2023 12:53

Hello I have a problem in installing the Microsoft Entity framework core, I really want to continue this project I hope you can help me with this, thanks.

Ответить
Roshel Judith
Roshel Judith - 01.02.2023 18:50

is this done using sql server databse?

Ответить
Jeremy Gann
Jeremy Gann - 28.01.2023 00:04

ugh... mine does not have a startup.cs... where do I add the dbContext in this case?

Ответить
Shivaji Suryavanshi
Shivaji Suryavanshi - 16.11.2022 08:09

thank you so much

Ответить
Shivaji Suryavanshi
Shivaji Suryavanshi - 16.11.2022 08:09

what if we don't have startup.cs do we have to create the startup.cs file or anthing else

Ответить
Фазлиддин Юлдашев
Фазлиддин Юлдашев - 01.11.2022 21:23

can you make more video with russian subtitles?)

Ответить
Darshan Pacharne
Darshan Pacharne - 01.11.2022 07:54

I cant find any startup file in my solution explorer.. please advice

Ответить
Issam El Hoss
Issam El Hoss - 20.07.2022 19:16

how do i do this in dotnet6 in the program.cs file? please help

Ответить
A Himachali boy
A Himachali boy - 17.07.2022 17:50

Sir there is no Startup.cs in my Visual studio code

Ответить
Thanusak Theerakate
Thanusak Theerakate - 05.06.2022 16:54

my project no has Startup.cs files

Ответить
Handan Unal
Handan Unal - 16.05.2022 22:58

Thanks, videos are very comprehensive, clear.

Ответить
일본어선생
일본어선생 - 12.05.2022 21:42

Is it possible to use DbContext on the Client side Web App? without API Server that means Directly contacting SQL server.

Ответить
Fawaz-Barca
Fawaz-Barca - 01.11.2021 22:59

pls what i do with this error
=====>System.InvalidOperationException: Unable to determine the relationship represented by navigation 'Cinema.Movies' of type 'List<Movie>'. Either manually configure the relationship, or ignore this property using the '[NotMapped]' attribute or by using 'EntityTypeBuilder.Ignore' in 'OnModelCreating'.

Ответить
Azim Lit.
Azim Lit. - 08.06.2021 03:23

Another outstanding tutorial !Your teaching style is awesome.. makes it easy for anybody to understand...

Ответить