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)

6642 results

System.InvalidOperationException: No suitable constructor found for entity type 'BoundingBox'

I'm using asp.net core 3.1 with entity framework core cosmos db provider. In my model I've a property for LocationCoordinates of type pointer. When checking if user exists I'm getting error....I'm using point class in my model class ApplicationUser. Micro...
asp.net-core asp.net-identity azure-cosmosdb c# entity-framework-core
asked by Mick

InvalidOperationException in ASP.NET Core MVC in Browser

I have an ASP.NET Core MVC application which uses Entity Framework Core O/RM. I am implementing generic repository pattern in my application. There are two entities, ...Employee... & ...Department.... There is one context class ...EmployeeDepartmentDetail...
asp.net-core-mvc c# dependency-injection entity-framework-core
asked by Nihal Singh

Unable to hit oracle stored proc using .Net EF(2.2) Core repository pattern

ORA-00900: invalid SQL statement...This is the error i get when i am trying to hit a stored procedure(in Oracle) from my API....I am using Repository pattern with Entity framework.(EF Core 2.2)...This is my call,...return FetchWithStoredProcedure("PROC_GE...
.net entity-framework-core oracle oracle-sqldeveloper repository-pattern
asked by Shekar.gvr

How to configure ASP.NET Core 3.1 website with identity, authentication and authorization to use Entity Framework 6.4

The purpose of providing a .NET Standard 2.1 version of EF6 is understood to be to assist the upgrading of existing projects in stages....So we have an existing solution that consists of websites, a windows service and console apps. We are in the process ...
asp.net-core-3.1 asp.net-identity entity-framework-6.4 entity-framework-core
asked by Naked Coder

EF Core migration generated `ReferentialAction.Restrict` but in context set as `DeleteBehavior.ClientSetNull`

I discover this while I tried to run my delete query when it stop my with the error ...The DELETE statement conflicted with the REFERENCE constraint "FK_List_ListId"...When I through an analysis to the issue, noticed that in the latest migration ...onDele...
c# entity-framework-core sql-server
asked by Riki

How do I add a new item into my database with 3 joined tables in EFCore/C#?

I want to add a new employee to my database. ...I have a SQL database with 3 tables: Companies, Teams, Employees. ...I have a list of companies in the database. Each company has several teams. Each team has several employees. ...The three tables are joine...
.net-core c# entity-framework-core sql
asked by Austin B

.net core 3.0 Auto migration does not create/update/ datatable automatically

I am building a project template using .net core 3.0 and Microsoft.EntityFrameworkCore. this will just created the database schema not the data table...if (!context.Database.EnsureCreated()) context.Database.Migrate(); ...Do we have an automatic migra...
asp.net-core entity-framework-core
asked by kellybazinga

Cannot connect to SQL from DotNet Core via VPN

I've tried solving this problem for days now, so I'm trying here to see if anyone have any more ideas to try....I can connect fine to my local SQL Express, but when trying to connect to SQL located at two different companies with separate VPNs, I can't fr...
.net-core c# entity-framework-core sql-server windows-firewall
asked by Arg0n

ASP.NET Core trouble in model binding

I'm new in ASp.NET Core. All data saved in database correctly, i tried show model data in View. Person model data gotten correctly, but second model Address didn't show in View. I suspect I made a mistake in the controller....First model:...public class P...
asp.net-core c# entity-framework-core
asked by Snow

How to unit test a function in .NET Core 3.1 that uses ExecuteSqlRawAsync to call a stored procedure?

I'm writing an API in ASP.NET Core 3.1, using EF Core to access a SQL Server database. I have a function in the API that needs to call a stored procedure with several input parameters and an output parameter. A simplified version of this function is below...
asp.net-core asp.net-core-3.1 entity-framework-core stored-procedures xunit.net
asked by Rob

Alternative for ElementAtOrDefault

My business logic is following. I have ...CustomerEvents... table. The table contains ...CreatedAt... column and ...CustomerId... column. I need to retrieve last and previous event for particular customer. About the last I have not problems. But what to d...
.net-core .net-core-3.1 c# entity-framework-core
asked by Aleksej_Shherbak

How to convert string to DateTime in C# EF Core query

var res = Context.Exampletable .Where(s => s.CompanyId == CompanyId && Convert.ToDateTime(s.TextDate) >= DateTime.Now) .Select(x => new Exampletable { TextDate = x.TextDate }) ...
ef-core-3.0 entity-framework entity-framework-core linq postgresql-9.1
asked by TedS

Catch duplicate key exception and continue to insert

I have the table in PostgreSQL with many records and unique key...CREATE TABLE parcels ( Id SERIAL PRIMARY KEY NOT NULL, Number CITEXT NOT NULL, UserId INT REFERENCES Stations(Id) NOT NULL, TimeStampUtc TIMESTAMP WITHOUT TIME ZONE NOT NULL...
c# ef-core-2.2 entity-framework entity-framework-core postgresql
asked by Chebur

Entity Framework .Net core not adding stored procedure classes

I am generating Entity Framework classes in a .NET Core application using this command:...Scaffold-DbContext "Server=server name;Database=DB name;user id=user name;password=password;Trusted_Connection=False;Encrypt=True;" Microsoft.EntityFramewo...
asp.net-core c# entity-framework-core stored-procedures
asked by urvish mandaliya

How can I switch the database provider used by EF Core based on configuration?

EF Core supports a lot of ...different providers... and I can configure them in ...Startup.cs... by specifying the provider. For example, if I want to use SQL Server, I can use:...services.AddDbContext<SomeContext>(options => { options.UseSqlServer(Co...
asp.net-core c# entity-framework entity-framework-core
asked by Saravana

Create related entry with foreign key

I'm making a Razor Page CRUD app with EF Core 3. I want users to select an existing person, and create for them a (lab) test entry. I'd be interested in how to do this from both the Person DetailView and from the Test IndexView....So far, I seem to be jus...
asp.net-core entity-framework-core razor-pages-crud
asked by J. Sizzler

EntityFrameworkCore .net Core update existing database structure without deleting existing data

Is there a way to update existing database structure without deleting existing data in .net core? it was working in .net EF6 but not in this version am i missing something?...All I have is ...namespace ProjectTemplate.Contexts { public class Dummy ...
asp.net-core entity-framework-core
asked by kellybazinga

How do I add a shadow property to an owned type?

Say I have a Customer entity with a list of owned types of Address. I also have an Office entity also with a list of owned types of Address....In my OnModelCreating() method I have:...modelBuilder.Entity<Customer>().OwnsMany(s => s.Addresses, a => { ...
entity-framework-core owned-types
asked by Mike Lenart

Entity Framework Core ForeignKey Default Conventions

I am looking for a document of ...[ForeignKey]... conventions. I found a list of naming conventions on ...MSDN.... ...I am not sure which convention maps the below action....class Student { public int id{ set; get;} public int myclassroomid{ set...
c# entity-framework entity-framework-core
asked by V.Wu

EF Core's Include() function not working from direct GET request

I am building this app using.NET Core 3.1 and my json output isn't right. Here is the class I want a list of:...[DataContract(IsReference = true)] public class State { public int Id { get; set; } [DataMember] public string Name { get; set; } ...
asp.net-core blazor c# entity-framework-core sql-server
asked by Bruno Blanes

Page 325 of 333
  • ««
  • «
  • …
  • 320
  • 321
  • 322
  • 323
  • 324
  • 325
  • 326
  • 327
  • 328
  • 329
  • …
  • »
  • »»

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!