Content
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…


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…


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…


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…


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>…


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 =…
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. …


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…


SaveChangesAsync is not Working .Without SavechangesAsync Data inserted into Database
public async Task<Result<ReturnResult>> Handle(CreateDocumentTypeCommand request, CancellationToken cancellationToken) { var documentType =…


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…


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…


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…


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…


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.…


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…


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 : …


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…


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…
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…


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,…

