Microsoft Q&A

Entity Framework Core

420 questions

A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.

Browse all .NET tags

420 questions with Entity Framework Core tags

Sort by: Updated
2 answers

Limiting columns in anEF Core Query

I'm using this method to return specific rows with specific columns from a SQL DB using EntityFramework Core Even with the ".Select(x => new Tbl016" expression I still get every single column in the table. Is there a way that I can…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
420 questions
asked 2021-11-04T18:44:56.17+00:00
Mohammad Radawan 106 Reputation points
commented 2022-11-09T15:18:26.88+00:00
Muhammad Kamran 1 Reputation point
1 answer

Configuration of entities to save summed values in database

Hi, I have two entity classes (Order, OrderItem) and one Value Object class (Money). Simplified code: public class Order { private Order() { } public int OrderId { get; private set; } public…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
420 questions
asked 2022-11-04T08:45:54.013+00:00
lukaszjazwiec 1 Reputation point
answered 2022-11-09T08:12:02.247+00:00
Zhanglong Wu-MSFT 251 Reputation points Microsoft Employee
3 answers

Why isn't my WCF/WPF service working?

This is my structure and what I did: WCF add Entity Framework IService add [OperationContract] in IService1 create DTO classes for things I needed Service in Service1 create class variable "Entity entity= new…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
420 questions
ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
1,175 questions
Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,173 questions
Windows Communication Foundation
Windows Communication Foundation
A Microsoft runtime and set of application programming interfaces in the .NET Framework for building service-oriented applications.
258 questions
asked 2022-09-10T08:37:21.763+00:00
Anonymous
answered 2022-11-08T06:56:45.673+00:00
ElChefe 76 Reputation points
0 answers

websecurity login not logged success althogth i have same user name and password on membership table ?

I working on c# web application i use the following code to login but it not logged success it show model state error although i have same user name and password on database so how to solve this issue please public JsonResult…

Entity Framework 6.0
Entity Framework 6.0
A Microsoft open-source object-database mapper for .NET.
216 questions
Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
420 questions
.NET Standard
.NET Standard
A formal specification of .NET APIs that are available on multiple .NET implementations.
482 questions
asked 2022-11-04T15:35:01.383+00:00
ahmed salah 3,126 Reputation points
commented 2022-11-07T08:43:53.287+00:00
Zhi Lv - MSFT 18,541 Reputation points Microsoft Employee
0 answers

Second value in dropdown list

<select class="form-select" asp-for="SpareParts.Item" asp-items="@(new SelectList(Model.Stocks,"ItemCode","ItemName"))"> <option value="">select...</option> </select>…

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
2,531 questions
Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
420 questions
asked 2022-11-01T11:29:20.07+00:00
Curious Cat 21 Reputation points
commented 2022-11-02T06:49:45.207+00:00
Zhi Lv - MSFT 18,541 Reputation points Microsoft Employee
2 answers One of the answers was accepted by the question author.

LINQ Expression Could not Be Translated

Hello everyone and thanks for the help in advance. I am creating a MVC application uisng .Net 6 and EF 6 to query a database. One of the functions is needed to search a date of birth. However, when I attempt to use the following: persons =…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
420 questions
ASP.NET MVC
ASP.NET MVC
A Microsoft web application framework that implements the model-view-controller (MVC) design pattern.
582 questions
asked 2022-10-28T19:13:58.377+00:00
Kmcnet 201 Reputation points
commented 2022-11-01T19:56:52.457+00:00
Kmcnet 201 Reputation points
0 answers

Another strange problem...

I am entering data into a table. During this (In the OnPostAsync scope), I do send an query to an another table, to obtain a missing data that doesn't is included in the data which comes the from. But at each try i get a strange rendered result. …

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
2,531 questions
Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
420 questions
ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
1,175 questions
asked 2022-11-01T12:40:44.427+00:00
Curious Cat 21 Reputation points
commented 2022-11-01T14:56:03.983+00:00
AgaveJoe 17,021 Reputation points
1 answer

Entity Framework Core Migrations within an Agile Team

Hello everyone! I would like to get some advice on working with EFCORE 6 within an agile team. What is the best and common way of handling EFCORE migrations within teams? we need to make it easy to apply and rollback features that may involve…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
420 questions
asked 2022-10-31T19:08:03.59+00:00
Ramy Gamal 1 Reputation point
answered 2022-11-01T05:46:30.577+00:00
Zhanglong Wu-MSFT 251 Reputation points Microsoft Employee
1 answer

SaveChangesAsync is not Working .Without SavechangesAsync Data inserted into Database

public async Task<Result<ReturnResult>> Handle(CreateDocumentTypeCommand request, CancellationToken cancellationToken) { var documentType =…

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
6,923 questions
Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
420 questions
Entity Framework 6.0
Entity Framework 6.0
A Microsoft open-source object-database mapper for .NET.
216 questions
asked 2022-10-19T10:29:36.073+00:00
Walidulhasan Boniamin 1 Reputation point
commented 2022-10-27T08:38:13.877+00:00
Jiale Xue - MSFT 1,646 Reputation points Microsoft Employee
1 answer

Create database from entity framework codefirst approach in server

Hi All, We are developing. netcore6 Web API using entity framework code first approach. We planned to deploy it in windows azure. How to create and deploy databases on servers? Using MySQL as database. To deploy I published…

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
6,923 questions
Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
420 questions
asked 2022-10-26T03:32:48.557+00:00
Binumon George 161 Reputation points
commented 2022-10-26T09:58:15.613+00:00
Karen Payne MVP 29,226 Reputation points Microsoft MVP
6 answers

What are the pros and cons of using stored procedures vs C# code for DB work?

If there is a better place to post them please advise. Based on the available tags I feel as if I'm not in the correct forum. My company has a long history of using stored procedures for even the most trivial of db queries. I am trying to convince…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
420 questions
SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
8,472 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
6,923 questions
asked 2021-01-19T22:07:49.4+00:00
Bernzweig, Bruce 96 Reputation points
commented 2022-10-25T21:37:06.66+00:00
Uchenna Nwosu 1 Reputation point
1 answer One of the answers was accepted by the question author.

EF6 Linq Navigation properties are always null

Here is the setup I have a product table public partial class Product { public uint Id {get; set;} public uint TypeId {get; set;} public virtual ProductType ProductTypeNavigation { get; set; } = null!; } public…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
420 questions
asked 2022-10-24T17:15:38.447+00:00
Jeff Vanhorn 21 Reputation points
accepted 2022-10-24T18:36:39.167+00:00
Jeff Vanhorn 21 Reputation points
1 answer One of the answers was accepted by the question author.

How to define foriegn key in my own classes.

Hi Folks, I am not sure if this is the right place to ask my question but it is somehow related to EF Core & Identity. I am using ASP.NET Core Identity in my project. I have added my own custom tables along with the tables created by Microsoft…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
420 questions
ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
2,531 questions
asked 2021-10-10T13:37:07.36+00:00
Imran Jalali 61 Reputation points
commented 2022-10-21T13:44:46.233+00:00
Wong Ke Ryn 1 Reputation point
3 answers

Add new Table to DbContext

Hi friends thanks for any help. But I have injected a DbContext into my controller. Since then I have added a new table to the Database that I am using with my DbContext, so obviously in my controller I dont see the new Table as a Dbset in my DbContext.…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
420 questions
asked 2022-10-10T00:56:24.717+00:00
Ronald Rex 61 Reputation points
answered 2022-10-19T07:13:27.693+00:00
Zhanglong Wu-MSFT 251 Reputation points Microsoft Employee
2 answers

MVC Controller with Views, using Entity Framework

Does Visual Studio Provide a Tool to Custom Design MVC Controller with Views, using Entity Framework template specific to the needs of the project? This is felt necessary because the <table> generated in Index.cshtml using the default template…

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
2,531 questions
Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
420 questions
Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
2,398 questions
asked 2022-10-10T12:32:25.947+00:00
raklali 236 Reputation points
commented 2022-10-13T03:01:04.217+00:00
Zhi Lv - MSFT 18,541 Reputation points Microsoft Employee
1 answer One of the answers was accepted by the question author.

razor pages EF 6.0 insert data

While adding data to the database, Some people insert data directly this way : ... ApplicationDbContext.Add(MyModel); await ApplicationDbContext.SaveChangesAsync(); ... And some peoplpe add line by line the table field names : …

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
2,531 questions
Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
420 questions
asked 2022-10-11T10:08:41.333+00:00
Curious Cat 21 Reputation points
accepted 2022-10-11T13:11:01.54+00:00
Curious Cat 21 Reputation points
3 answers

erro in command: dotnet-ef database update in linux

After migrations, I try to run the command: dotnet-ef database update The following error occurs: network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not…

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
8,472 questions
Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
420 questions
Skype for Business Linux
Skype for Business Linux
Skype for Business: A Microsoft communications service that provides communications capabilities across presence, instant messaging, audio/video calling, and an online meeting experience that includes audio, video, and web conferencing.Linux: A family of open-source Unix-like operating systems.
448 questions
asked 2022-10-08T14:06:09.617+00:00
niltongc 1 Reputation point
answered 2022-10-10T22:51:08.75+00:00
Dan Guzman 6,926 Reputation points
7 answers

How to publish my Net Core 6 website on my Windows Server 2022 and link а domain name to it?

HI! How can I publish my Net Core 6 website on my Windows Server 2022 and link а domain name to it? Does anyone have links to an approximate sequence of actions? I raised IIS on Windows Server 2012 R2 a long time ago, but then I had Apache HTTP…

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
2,531 questions
Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
420 questions
Internet Information Services
asked 2022-10-08T09:30:26.303+00:00
Volk Volk 221 Reputation points
answered 2022-10-10T19:23:15.47+00:00
Volk Volk 221 Reputation points
1 answer

CORS issue in .NET Core 6 API

When I deploy my API to the server and I try to consume APIs from a React app, I always get CORS errors. Frontend: https://dev.livedispatch.ca Backend: https://backend-dev.livedispatch.ca I followed this tutorial and nothing works, I get…

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
2,531 questions
Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
420 questions
asked 2022-10-04T17:15:28.77+00:00
Stesvis 1,016 Reputation points
answered 2022-10-05T17:32:58.74+00:00
Bruce (SqlWork.com) 27,941 Reputation points
1 answer One of the answers was accepted by the question author.

Visual Studio 2022 for mac, PM console or CLI to use entity framework command (add-migration, update-database, ecc.)

Hello, I'm using Visual Studio 2022 for mac, I have understood that the preview version not include PM console or CLI to use entity framework command. So, how can I do it? Which is the way to use entity framework commands, such as add-migration,…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
420 questions
.NET
.NET
Microsoft Technologies based on the .NET software framework.
601 questions
asked 2022-09-29T14:35:53.23+00:00
Igor Baldacci 41 Reputation points
commented 2022-10-05T14:15:28.077+00:00
Igor Baldacci 41 Reputation points