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

Entity Framework Core - Knowledge Base (KB)

67 results in tag: npgsql

Error when executing SaveChanges() with key field on Npgsql

I have a problem with my ...Npgsql... model when execute ...SaveChanges... method from a DbContext: ... A null store-generated value was returned for a non-nullable member 'Id' of type 'Easylab.DAO.Contextos.LogCad'. ...Maybe ...Npgsql... doesn't ...
asp.net-mvc-4 c# entity-framework entity-framework-6 npgsql
asked by GustavoAdolfo

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

Entity Framework 6 Programmatically Connect to Postgres

I'm working on programmatically establishing a connection to PostgresSQL using Entity Framework 6. I have this class:...public class ClearspanDatabaseContext : DbContext ...with this constructor:...public ClearspanDatabaseContext() : base(buildConnect...
connection-string database-connection entity-framework entity-framework-6 npgsql
asked by Nick Gilbert

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.

NpgSQL 3 Code First Connection String

I am trying to setup a project with EF6 and NpgSQL 3.x...I took the following steps:...Used Nuget to install Entity Framework 6...List item...Add connections string to .config file using syntax described here: ...http://www.npgsql.org/doc/connection-strin...
entity-framework entity-framework-6 npgsql
asked by Element

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

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

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

Entity Framework Core 1.0.0: Eager loading with Where-clause

When I used EntityFramework 7.0.0-rc1 I wrote something like this:...context.MyEntity .Include(e=>e.MySubEntities) .Where(e=>e.MySubEntities.Contains(value)) .Where(e=>e.Status==1) .ToList(); ...In EFCore 1.0.0 the same code throws an exception. I suppose...
c# entity-framework-core npgsql
asked by Slip

Entity Framework Core navigation properties over-eagerly loading

I'm just starting to play with EF core (using NPGSQL), and have noticed some strange behavior on how navigation properties are being loaded without expressly using an 'include'. An example I'm seeing:...ObjectA...ObjectA->List ObjectB | ObjectA->List Obje...
c# entity-framework-core npgsql
asked by Michael Cowart

npgsql - stop using 'template1' database

I want to use elephantsql database with entity framework (whichever version). I found tutorial on the internet about npgsql which can help me connect those 2 piece of technology....I made an object which will represent object from DB :...[Table("typychoro...
entity-framework entity-framework-6 npgsql
asked by Shoter

Using a custom attribute in EF7 (core) OnModelCreating

I have a ...DefaultAttribute... defined like so:...[AttributeUsage(AttributeTargets.Property)] public class DefaultAttribute : Attribute { /// <summary> /// Specifies this property has a default value upon creation. /// </summary> /// <par...
c# ef-code-first entity-framework entity-framework-core npgsql
asked by Jeremy Holovacs

Microsoft.EntityFrameworkCore.Relational namespace (using) won't resolve

I'm using EF as my ORM, and I need to execute some raw SQL against my postgres DB, to offload some JSON (jsonb) processing....I'm using EntityFramework Core 1.1.0, with the npgsql provider for postgres. Per the latest docs on executing SQL, I need to use...
.net-core asp.net-core entity-framework-core npgsql
asked by Ian Field

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

Entity Framework Core jsonb column type

I am using Entity Framework Core with npgsql postgresql for Entity Framework Core....My question is, using migrations, how do I mark a class property to generate a JSONB column type?...For example:...public class MyTableClass { public int Id { get; se...
c# entity-framework-core npgsql postgresql
asked by bruno.almeida

How to use EF Core concurrency token created by ForNpgsqlUseXminAsConcurrencyToken

I have found npgsql provider ...extension... to set up concurrency token for entity framework core entity, which should do something like this:...modelBuilder.Entity<MyEntity>(b => { b.Property<uint>("xmin") .HasColumnType("xid") .Valu...
asp.net-core c# concurrency entity-framework-core npgsql
asked by Fanda

NpgSql - How to call a stored procedure (void function) from EF core - asynchronously

I think there are a couple of questions embedded in here....First, all documentation on calling a function from EF core seems to assume I'm waiting for a result set. E.g.:..._context.Set<MyEntity>().FromSql<MyEntity>("select myDbFunction({0})", myParam);...
c# entity-framework-core npgsql postgresql
asked by Ian Field

No db context provider has been configure for this DbContext... although it has

Have a solution with 3 assemblies: Data, Domain and Web. Data holds the context, Web is a .NET Core WebAPI app, and they're all in the same solution directory. I'm also using Postgre as the database....Here's my ...ConfigureServices... method in ...Startu...
c# entity-framework-core npgsql
asked by Jakov

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

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
Get monthly updates by subscribing to our newsletter!
SUBSCRIBE!