zzz projects Entity Framework Core EF Core
Home EF Core 5 Articles Knowledge Base Online Examples
  • Home
  • EF Core 5
  • Articles
  • Knowledge Base
  • Online Examples

Entity Framework Core - Knowledge Base (KB)

96 results for: in tag: postgresql

Trying to using EF 6 with PostgreSQL - Failed to find or load the registered .Net Framework Data Provider

I am trying to use EF 6 Code First with Npgsql provider. When I try to run Add-Migration command in package manager I have the following exception: ...Failed to find or load the registered .Net Framework Data Provider....PM> Add-Migration -Force -Configur...
c# entity-framework entity-framework-6 npgsql postgresql
asked by Don Tomato

ASP vNext and PostgreSql

exists currently any way, how to communicate with PostgreSql database, when I want to use ASP.NET vNext? I'm looking for solution, which will work mainly on linux....EF7 supports only MS SQL a SqlLite now and Npgsql isn't ported for ASP.NET vNext....Thank...
asp.net-core c# entity-framework-core postgresql
asked by Rudis

How to use EF7 from VSCode in Mac?

I'm new to C# and I'm trying to connect to a DB preferably PostgreSQL (or do I must use MS SQL?). How do I do that in VSCode and Mac (using dnx CLI)?
c# entity-framework-core postgresql visual-studio-code
asked by Tingan Ho

Configuring EF and Npgsql for code first

I'm trying to get EF to work with Postgresql. I would like code-first migrations if possible. So far, I got a simple ADO command to work, so I'm pretty sure at least my connection string is right. But I can't get EF code migrations to work for the life of...
ef-code-first entity-framework entity-framework-6 npgsql postgresql
asked by Sava B.

Case insensitive name of tables and properties in Entity Framework 7

I use Entity Framework 7 with Npgsql adapter. Sql generated by EF seems like...SELECT "r"."Id", "r"."Name" FROM "public"."Role" AS "r" ...and it doesn't work in Postgres, because case-sensitive policy. To make it work i need to write create table script ....
c# entity-framework entity-framework-core npgsql postgresql
asked by user3272018

Auto-increment on partial primary key with Entity Framework Core

I have declared the following model using the EF Core fluent API:...modelBuilder.Entity<Foo>() .HasKey(p => new { p.Name, p.Id }); ...Both fields are marked as the primary key when I create the database in PostgreSQL but the Id field is not marked as ...
asp.net c# entity-framework entity-framework-core postgresql
asked by Martin

IServiceCollection does not contain a definition or extension for AddNpgsql

I'm trying to use PostgreSQL for the first time and having a little trouble getting it to build without errors unless I lock into RC2 packages which is fine. After locking into the RC2 packages, I have one error that I can't seem to shake that I could use...
asp.net asp.net-core entity-framework-core postgresql
asked by chris

How do I configure Entity Framework to allow database-generate uuid for PostgreSQL (npgsql)?

I'm updating our dotnet core project to use PostgreSQL on the backend instead of Microsoft SQL Server and hit a situation with two tables that use a GUID as the data type. ...ERROR...Unhandled Exception: System.Reflection.TargetInvocationException: Excep...
asp.net asp.net-core entity-framework-core npgsql postgresql
asked by chris

Connect to PostgreSQL database using EntityFramework 6 (C#)

I am trying to create database on PostgreSQL server using Entity Framework Code-First in C# application. I have downloaded Npgsql for EF and tried to change my App.config file in different ways presented on Internet, however none works....This is my App.c...
.net c# entity-framework entity-framework-6 postgresql
asked by Niko

How to implement Select For Update in EF Core

As far as I've understood it, there is no option in EF (and EF Core) to explicitly lock resources which I'm querying, but I'll need this functionality quite often and don't really feel like falling back to writing select statements every time I'll need it...
entity-framework entity-framework-core npgsql postgresql
asked by peter

Asp.Net Core 1.0.0: Npgsql.EntityFrameworkCore.PostgreSQL Migration error

My ...Startup.cs...:... services.AddEntityFrameworkNpgsql() .AddDbContext<ApplicationDbContext>(o => o.UseNpgsql(Configuration["Data:DefaultConnection:ConnectionString"] )); ...My ...project.json...:..."Npgsql.EntityFrameworkCore.Postgr...
asp.net-core c# entity-framework-core npgsql postgresql
asked by Slip

Open/Close database in ASP.NET Core for every SQL command

I write simple ASP.NET Core app where Controller injects MyService (configured as Scoped) that in turn injects MyDbContext....In my controller's method I have 2 database queries and my debug output looks like this: ... Executing action method... Opening ...
asp.net-core c# entity-framework-core npgsql postgresql
asked by Rem

EF Core FromSQL query does not get executed immediately (PostgreSQL)

I have written a function in PostgreSQL for insertion as follows:...CREATE OR REPLACE FUNCTION public.insert_blog("Url" character) RETURNS void AS $BODY$Begin Insert Into "Blogs"("Url") Values("Url"); End$BODY$ LANGUAGE plpgsql VOLATILE COST 100...
.net-core entity-framework-core function postgresql stored-procedures
asked by Amol Kolekar

Entity Framework Identity Column Negative Value

I have an ASP.NET Core 1.0 web application that implements some REST web services which interact with a PostgreSQL database via Entity Framework Core....In my model, I have a variety of code-first entity classes that utilize the following pattern:...[Key]...
asp.net-core entity-framework-core postgresql
asked by robbpriestley

Auto-Incremented value not working in PostgreSQL when using EntityFramework Core

It seems like the auto-increment function for PostgreSQL doesn't seem to work....I have the following code:...namespace project.Models { public class DatabaseModel { [Key] [DatabaseGenerated(DatabaseGeneratedOption.Identity)] [C...
asp.net-core entity-framework-core postgresql
asked by Wouter

EF Core with Postgres is generating negative primary keys

I'm using Entity Framework Core with the Postgres provider, each entity has an int primary key with ValueGeneratedOnAdd. This has been working perfectly up until now. Every now and then I nuke my migrations and database and start fresh with ...dotnet ef m...
c# entity-framework entity-framework-core postgresql
asked by Craigt

Perform two related operations in EF Core

In my ASP.NET Core app I have DbContext that contains two types of Entities, say, Pupils and Classes. I want to add a new Class, get the Id of new Class and add a new Pupil to the class. I tried to do it this way:...var Class = new Class{ name = "Math" };...
asp.net-core c# entity-framework entity-framework-core postgresql
asked by Rem

Can I fire an event on connect database in Entity Framework Core?

I've one DbContext with all working to access my Postgresql DB, but I need to run one little SQL command when connection session starts with DB. I need to do this for every interaction. To be more specific, it's a function for set a session variable with ...
c# entity-framework-core postgresql
asked by Luciano Trez

Doesn't retrieve the related table data in Entity Framework Core with PostgreSQL

I'm trying Entity Framework Core with PostgreSQL. I have two tables that are one to many relationship. According to the relationship, Movie has a Year and Year has many Movies. But Once I retrieve movies, the year doesn't contain in it, year in each movie...
asp.net-core-1.0 entity-framework-core postgresql
asked by Neo

Why does my Required property not being cascade deleted in Entity Framework Core?

I have the following class with a required property, and am running into issues deleting dependent properties via cascade delete....public class City { [Key] public int Id {get; private set; } [Required] public ZipCode ZipCode { get; ...
c# entity-framework-core npgsql postgresql
asked by ArKi

Page 1 of 5
  • 1
  • 2
  • 3
  • 4
  • 5
  • ยป

Prime Library

Performance

  • Entity Framework Extensions
  • Entity Framework Classic
  • Bulk Operations
  • Dapper Plus

Expression Evaluator

  • C# Eval Expression
  • SQL Eval Function
More Projects...

Related

  • EF Extensions Online Benchmark
  • WIN an EF Extensions license
  • EF6 BatchSaveChanges for only $79