Setup PostgreSQL in .NET with Entity Framework

  Рет қаралды 47,623

ZetBit

ZetBit

Күн бұрын

Пікірлер: 43
@OwenSaysNo
@OwenSaysNo Жыл бұрын
Best setup tutorial for this that I've come across so far. I love that you take the time to highlight what certain functions and sections of code actually do.
@zetbit
@zetbit Жыл бұрын
Always happy to help, and I do also believe in that knowing to most of the code will help to become a better programmer and much easier to work with code that we actually know what is doing 😊
@EdgarKnapp
@EdgarKnapp 7 ай бұрын
Also works for .NET 8 out of the box.
@MsJackkky
@MsJackkky 3 ай бұрын
Thank you, sir! It works for entity framework 8.0.6 as well. Love your style - a lot of information and nothing extra. Definitely like
@thereversejosh
@thereversejosh Жыл бұрын
Good video, straight to the point with good explanation. I'm currently doing a course on dotnet which uses MySQL for database, but I wanted to use Postgre and I found having this video of only the configuration very helpful. Thanks for this!
@kemalhariz
@kemalhariz Жыл бұрын
Thanks man, i've been stuck for hours looking on how to do this. With your explanation it also helped me a lot
@zetbit
@zetbit Жыл бұрын
Good to hear! Always happy to help! 😁
@zetbit
@zetbit Жыл бұрын
Support by hitting 2 buttons! Like and Subscribe 👏
@KillTasTiK1
@KillTasTiK1 Жыл бұрын
Thanks for the great tutorial. Keep up the good work. 👍
@zetbit
@zetbit Жыл бұрын
Thanks for the kind words! 🙏
@manuelgonzalotoribioruizal1416
@manuelgonzalotoribioruizal1416 Жыл бұрын
Thank you. Watching your video I realized that I forgot the dbcontext
@zetbit
@zetbit Жыл бұрын
No problem 😁
@Brynjar1
@Brynjar1 4 ай бұрын
Worked like charm, thanks!
@jannekorhonen6263
@jannekorhonen6263 3 ай бұрын
Nice job! Thank you!
@Ya_kruutoy
@Ya_kruutoy Жыл бұрын
I watched your video and everything became clear thanks, but nevertheless I had to dig into the documentation to understand that your AppDbContext class on the new version looks like this; using Microsoft.EntityFrameworkCore; using System.Collections.Generic; public class ApplicationContext: DbContext { public DbSet Users => Set(); public ApplicationContext() => Database.EnsureCreated(); protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { optionsBuilder.UseNpgsql("Host=localhost;Port=5432;Database=first;Username=postgres;Password=1"); } }
@zetbit
@zetbit Жыл бұрын
Awesome, thanks for sharing 💪😁
@majormartintibor
@majormartintibor Жыл бұрын
At the beginning of the video you mention you can set it up in a Blazor Server App. While this is true I want to strongly suggest that in Blazor Server you use: .AddDbContextFactory(options => options.UseNpgsql(connectionString)); dbContext is not thread safe, even for one user when multiple components use the dbContext you can get yourself into a lot of headache. Instead Inject the DbContextFactory into your component and override the OnInitializedAsync, get yourself a dbContext from the factory and safe it in a variable. This way each component gets its own dbContext and you saved yourself the headache while still allowing the dbContext to function as a UnitOfWork.
@zetbit
@zetbit Жыл бұрын
You are completely right, thanks for the tip. I first discovered the factory after this video 😊
@animeamv8641
@animeamv8641 8 ай бұрын
saved my life
@xisbie75
@xisbie75 Жыл бұрын
I Love you man, you are perfect!
@zetbit
@zetbit Жыл бұрын
Always happy to help 😁
@RohitKumarLadhar
@RohitKumarLadhar 8 ай бұрын
Great video Straightforward thing
@zodexnl
@zodexnl 6 ай бұрын
Many Thanks!! Clear tutorial!!
@neohcheeking7590
@neohcheeking7590 7 ай бұрын
Great tutorial video
@罗思雨-m1t
@罗思雨-m1t Жыл бұрын
you really help me! thank you very much
@sathishramamurthi8151
@sathishramamurthi8151 10 ай бұрын
It worked for me . Thank u lot
@EdisonCPP2
@EdisonCPP2 Жыл бұрын
Thanks for the video, does it work with application users if you tell it to use Individual Accounts, and OAuth2 database tables for things like Google Sign in? I didn't know if those features were SQL Serve specific or not.
@zetbit
@zetbit Жыл бұрын
I have never tried it. Would be a nice thing to dive into though 😁
@EdisonCPP2
@EdisonCPP2 Жыл бұрын
@@zetbit I got it working, nice. I tried it on a sample project before converting a project I have that I had been considering using Postgresql on.
@Pro-wz5mz
@Pro-wz5mz Жыл бұрын
Thank You.
@zetbit
@zetbit Жыл бұрын
No problem 👌
@brawlboy1382
@brawlboy1382 6 ай бұрын
it said "Applying migration ''" and tables are empty
@turin_nowadays
@turin_nowadays 4 ай бұрын
Thanks a lot!
@abdullahgomaa1
@abdullahgomaa1 10 ай бұрын
Thank You
@DevDivine
@DevDivine Жыл бұрын
thank you
@zetbit
@zetbit Жыл бұрын
No problem 😁
@mustijack
@mustijack 5 ай бұрын
Cool, Thanks
@emcio5
@emcio5 Жыл бұрын
if you have problem with unable to create Simple solution to create empty construction in appdbcontest too and its work
@zetbit
@zetbit Жыл бұрын
Not sure I understand 💪
@426tunn
@426tunn 11 ай бұрын
i'm having this erro while trying to install entityframeworkcore: error: Object reference not set to an instance of an object. can someone help pls
@_nfl_nerd_
@_nfl_nerd_ Жыл бұрын
For the date type what you type in the Model? For example created_at, deleted_at, birth_date ? public DateTime? public DateOnly?
@r3dal1ce
@r3dal1ce 10 ай бұрын
public DateTime Date { get; set; }
In Depth Entity Framework Migrations with Postgres
26:51
ScriptBytes
Рет қаралды 11 М.
Brutally honest advice for new .NET Web Developers
7:19
Ed Andersen
Рет қаралды 232 М.
ЗНАЛИ? ТОЛЬКО ОАЭ 🤫
00:13
Сам себе сушист
Рет қаралды 3,7 МЛН
Try Not To Laugh 😅 the Best of BoxtoxTv 👌
00:18
boxtoxtv
Рет қаралды 6 МЛН
Человек паук уже не тот
00:32
Miracle
Рет қаралды 2,5 МЛН
Getting Started with Entity Framework Core in .NET
26:51
Nick Chapsas
Рет қаралды 23 М.
Solving one of PostgreSQL's biggest weaknesses.
17:12
Dreams of Code
Рет қаралды 209 М.
Creating .Net Core Microservices using Clean Architecture
26:02
Rahul Sahay
Рет қаралды 21 М.
MVC Entity Framework CRUD Operations PostgreSQL PGAdmin
16:42
Haritha Computers & Technology
Рет қаралды 16 М.
How to Connect to PostgreSQL with EF Core: A Step-by-Step Guide
14:06
Should I Create A Minimal API Or Full API?
7:40
IAmTimCorey
Рет қаралды 38 М.
What Are Your Thoughts on Entity Framework Core vs. Dapper?
21:49