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)

108 results in tag: asp.net-core-webapi

ASP.NET Core with EF Core - DTO Collection mapping

I am trying to use (POST/PUT) a DTO object with a collection of child objects from JavaScript to an ASP.NET Core (Web API) with an EF Core context as my data source. ...The main DTO class is something like this (...simplified of course...):...public class...
asp.net-core asp.net-core-webapi automapper entity-framework-core
asked by jmw

Entity Framework Core: Include many-to-many related objects in WebAPI

I'm not too familiar with the .NET framework but decided to try out ASP.NET Core and EF Core. I want to make a pretty simple Web API backend but I'm having trouble working with many-to-many relationships....I understand that I need to make a relationship ...
asp.net-core asp.net-core-webapi entity-framework entity-framework-core linq
asked by yalibaba

EF Core Query multiple tables with condition between

I have 2 tables with the following structure:...User...UserId | Age ---------------- 1 15 2 36 3 25 ...DictAges...Title | FromAge | ToAge ------------------------------- 1 0 20 2 ...
asp.net-core-webapi entity-framework entity-framework-core
asked by Kiss Koppány

EntityFramework Core reference causes compiler error

I've added the entityframework core reference into my full framework core webapi project but it causes an error. I have registered the db context in Startup.cs as shown in the screen shot below. When I attempt to run it (using dotnet run) the code throw...
asp.net-core-webapi c# entity-framework-core
asked by Jamie

EF Core MySQL Contains(variable) like operator

I am using ASP.NET Web API Core with EF Core to create a method, which returns JSON format records.... When I use ...contains... for ...like operator (%varible%)..., an error occured with message below:...An exception of type 'MySql.Data.MySqlClient.MySql...
asp.net-core-webapi entity-framework entity-framework-core mysql
asked by Code Man

Json response does not contain all the navigation properties EntityFramework Core and ASP .NETCore Web API

I have migrated from Entity Framework 6 to EF Core and also Web Api .net framework to .net core....I have many to many relationship that I have set up as follows...protected override void OnModelCreating(ModelBuilder modelBuilder) { var instru...
asp.net-core-webapi entity-framework-core
asked by carlosJ

Update model with TryUpdateModel in ASP.NET MVC Core Web API and Entity Framework Core doesn't work

I'm new to ASP.NET MVC Core Web API and EF Core, and I'm creating a simple MVC web API demo as follows....[HttpPut("{id}")] public async void Put(int id, [FromBody]Student student) { if (ModelState.IsValid) { var stu = _con...
asp.net-core-mvc asp.net-core-webapi entity-framework-core
asked by James L.

Entity Framework .Net core FindAsync Throw System.OverflowException: Arithmetic operation resulted in an overflow

I'm trying to create a web API for authentication that return a token. I'm using .Net core 1.1, EF 1.1.0 and SQL 2014 express on Windows 10. I follow direction from ...this... website to create required classes....In the middleware class, there's a functi...
.net-core asp.net-core-webapi entity-framework-core
asked by Andrianto Dwi Laksono

How to stop self-referencing loop in .Net Core Web API?

I'm having some issues which I'm guessing are related to self-referencing using .NET Core Web API and Entity Framework Core. My Web API starting choking when I added .Includes for some navigation properties....I found what appears to be a solution in the...
asp.net-core-webapi c# entity-framework-core
asked by Sailing Judo

add-migration : Cannot bind argument to parameter 'Path' because it is an empty string

I'm running default api core project on Visual studio 2017 with docker support and I got this error everytime I run the command ...add-migration -name name...add-migration : Cannot bind argument to parameter 'Path' because it is an empty string. At line...
asp.net-core-webapi docker entity-framework-core visual-studio-2017
asked by Hayha

Updating related data with Entity Framework Core

Im building a simple webapi with Entity Framework Core. I am using models and viewmodels to manage what data the client is actually receiving. Here's the models and viewmodels i created:...public class Team : BaseEntity { [Key] public int TeamId {...
asp.net-core-webapi asp.net-web-api c# entity-framework-core
asked by hs2d

One Web API Controller to control all models

I am creating a MVC Core 1.0.1 project that will include both API and Web. So i have created my models and now i want to create CRUD operations within a single controller instead of scaffolding each model. I have created an ApiController that looks like t...
api-design asp.net-core-mvc asp.net-core-webapi c# entity-framework-core
asked by Dimitris Laliotis

.net core 1.1 entityframework and mysql database connection

I am install vs 2017 and try to create a test web api project with .net core 1.1 ,entity framework and my sql database ....bellow is package list I am using ...<Project Sdk="Microsoft.NET.Sdk.Web"> <PropertyGroup> <TargetFramework>netcoreapp1.1</Ta...
.net-core asp.net-core-webapi c# entity-framework-core mysql
asked by kuntal

How to handle data set having multiple tables in Dotnet core using Fromsql()

I am creating WebApi using dot net core...I have created procedure which returns data from 2 tables AS:-...select * from table1 select * from table2 ...I have model list as:-...public class ModelList { public model1 m1 { get; set; } public model2 m2 { get...
.net .net-core asp.net asp.net-core-webapi entity-framework-core
asked by Munish Sharma

EntityFrameworkCore: How to save an entity with ForeignKey to another model?

I have a model that relates to another:...public class Portfolio : BaseEntity, IEntityBase { public string Name { get; set; } public Org Organization { get; set; } public bool IsPrivate { get; set; } } ...When I try to save...
asp.net-core asp.net-core-mvc asp.net-core-webapi c# entity-framework-core
asked by abolotnov

Entity Framework Core 1.1 OnModelCreating method not getting called

I have created a DBContext class in a .Net Standard 1.4 and have some code for entity configuration, in the OnModelCreating method, but it looks like this method is not getting called and I am getting an error complaining about a column name....Here is my...
.net-core .net-standard asp.net-core asp.net-core-webapi entity-framework-core
asked by Aram

OData with EF Core / ASP.NET Core - Good or Bad?

I've read a lot about OData with EF Core / ASP.NET Core. It seems to me that everybody has an opinion on this and It's gotten a bit confusing, so at the risk of sounding dumb, I have a few questions:...Please note: ...! I'm NOT talking about the classic A...
asp.net-core asp.net-core-webapi entity-framework entity-framework-core odata
asked by PaxForce

AutoMapper setting all properties to NULL on destination

In an ASP.NET Core 1.1 Web API, I am trying to map an entity model to a DTO using AutoMapper....The entity model:...namespace InspectionsData.Models { [Table("property")] public class Property { [Key] [DatabaseGenerated(Databa...
asp.net-core-1.1 asp.net-core-mvc asp.net-core-webapi automapper entity-framework-core
asked by Fabricio Rodriguez

MySql EntityFrameworkCore System.TypeLoadException

I am trying to connect my web API to MySql database with this code:...public class Startup { public void ConfigureServices(IServiceCollection services) { string conn_string = "server=server;database=database;uid=uid;pwd=pwd;"; ...
asp.net-core-2.0 asp.net-core-webapi entity-framework-core mysql
asked by Marcel Jr. Samson Morasse

ASP.Net Core how to get the user role in EF Core and Identity

Hi I'm building a API using Identity with a custom user class,and EF Core. I want to get the name of the role that belongs to an user. The diagram of the tables is the following(ignore userclaims and userlogins): ...As you can see the Roles and Users is ...
asp.net-core asp.net-core-webapi c# entity-framework-core
asked by Angel Silva

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

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!