✅ Integrating Postgre from EF
I am building a MVC app from ASP.NET I cant seem to create the database due to npgsql.design package being depreciated what could I do for this.
72 Replies
Unknown User•2mo ago
Message Not Public
Sign In & Join Server To View
im using postgre 17 and for EF package is 9.0.3 lastest package.
using Careconnect.Data; // your DbContext namespace
using Microsoft.EntityFrameworkCore;
var builder = WebApplication.CreateBuilder(args);
// Add services to the container with Neon PostgreSQL connection
builder.Services.AddDbContext<CareconnectContext>(options =>
options.UseNpgsql(builder.Configuration.GetConnectionString("DefaultConnection")));
builder.Services.AddControllersWithViews();
var app = builder.Build();
// Configure the HTTP request pipeline.
if (!app.Environment.IsDevelopment())
{
app.UseExceptionHandler("/Home/Error");
// The default HSTS value is 30 days.
app.UseHsts();
}
app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseRouting();
app.UseAuthorization();
app.MapControllerRoute(
name: "default",
pattern: "{controller=Home}/{action=Index}/{id?}");
app.Run();
Unknown User•2mo ago
Message Not Public
Sign In & Join Server To View
yeah i know
wait let me just drop that
wait it just worked now
lol
wait let me check on it again
Unknown User•2mo ago
Message Not Public
Sign In & Join Server To View
hey thanks for it
Unknown User•2mo ago
Message Not Public
Sign In & Join Server To View
wait let me share the csproj now
I used the EF core design package
Unknown User•2mo ago
Message Not Public
Sign In & Join Server To View
and npgsql design package was depreciated
Unknown User•2mo ago
Message Not Public
Sign In & Join Server To View
but doesnt it create complications
Unknown User•2mo ago
Message Not Public
Sign In & Join Server To View
since Npgsql design was depreciated i used the one which we normally use for mssql design
Unknown User•2mo ago
Message Not Public
Sign In & Join Server To View
ohh i was looking at a tutorial and doing thou hehe
then since I couldnt get the npgsql thing sorted i tried with gpt
Unknown User•2mo ago
Message Not Public
Sign In & Join Server To View
well i tried them all tbh to see which works lol
Unknown User•2mo ago
Message Not Public
Sign In & Join Server To View
https://www.npgsql.org/efcore/index.html?tabs=onconfiguring i was looking at this but couldnt find anything on the design depreciation
ohh thanks that really makes sense
I will again try creating this from scratch and see.
Unknown User•2mo ago
Message Not Public
Sign In & Join Server To View
thanks
Unknown User•2mo ago
Message Not Public
Sign In & Join Server To View
GitHub
Pull requests · npgsql/efcore.pg
Entity Framework Core provider for PostgreSQL. Contribute to npgsql/efcore.pg development by creating an account on GitHub.
thanks
Unknown User•2mo ago
Message Not Public
Sign In & Join Server To View
ohh
got it thanks
well i thought its something to be PRd to the official repo
Unknown User•2mo ago
Message Not Public
Sign In & Join Server To View
thanks for explaining that
Unknown User•2mo ago
Message Not Public
Sign In & Join Server To View
For now locally but now have to connect on the DB on neon.
Yes Thanks
Unknown User•2mo ago
Message Not Public
Sign In & Join Server To View
https://neon.com/ this
Neon
Neon Serverless Postgres — Ship faster
The database you love, on a serverless platform designed to help you build reliable and scalable applications faster.
for now then have to get all these on to Azure
what are your thoughts on alternatives
Unknown User•2mo ago
Message Not Public
Sign In & Join Server To View
We are trying to scale this up anyways and since we are handling patient records and all I was thinking better for getting into Azure. And my friend is also very familiar with the microsoft infrasturcture so ..
I understand the budget would be crucial for Azure but just wanted to pilot run and see.
runs on web and mobile
Unknown User•2mo ago
Message Not Public
Sign In & Join Server To View
yes
VM would be setup on Azure to run the server with docker containerised and the postgre on azure could be used for DB
Unknown User•2mo ago
Message Not Public
Sign In & Join Server To View
ohh yeah that will drop down the cost substiantially right
Unknown User•2mo ago
Message Not Public
Sign In & Join Server To View
makesense
Unknown User•2mo ago
Message Not Public
Sign In & Join Server To View
yeah I saw it a while back have to check up on these
Unknown User•2mo ago
Message Not Public
Sign In & Join Server To View
i was thinking the mssql inside could be expensive than the postgre option
if theres token handling then that is much easier right
Unknown User•2mo ago
Message Not Public
Sign In & Join Server To View
sure I will look up on both options anyway
Unknown User•2mo ago
Message Not Public
Sign In & Join Server To View
I think its best practice to do so anyways. But theres another additional service under the cost.
was thinking of a static user/password mode but should keep space for MI when scaling
Unknown User•2mo ago
Message Not Public
Sign In & Join Server To View
thats gonna be a problem for sure
Unknown User•2mo ago
Message Not Public
Sign In & Join Server To View
yes yes theres a lot of key words init
makes sense man theres a lot of ground work now. Sure will read them up now.
Unknown User•2mo ago
Message Not Public
Sign In & Join Server To View
was just gonna ask that
Unknown User•2mo ago
Message Not Public
Sign In & Join Server To View
haha
i had used with rails once
but nothing extensive
it was three tables with straight connections
Unknown User•2mo ago
Message Not Public
Sign In & Join Server To View
i think it was because of all the hype only we decided to go with PG
Unknown User•2mo ago
Message Not Public
Sign In & Join Server To View
that was 14
not the new update
ohh thats why everyone is talking about postgre
Unknown User•2mo ago
Message Not Public
Sign In & Join Server To View
but this is pretty decent now right you dont need seperate table for user roles now init
Unknown User•2mo ago
Message Not Public
Sign In & Join Server To View
ohh this is gonna take more and more time now lol
Unknown User•2mo ago
Message Not Public
Sign In & Join Server To View
I will look into it man thanks