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,…
How to set client Id in entity framework core (EF6) in DBContext
Hi There, We have a Web API in .NET 6 which uses entity framework core (EF 6). In our application we have Oracle database (19c) which has certain business use case specific tables. And, corresponding to that are history tables which gets populated…
One Bindinglist from multible DbSets to gridview
Just wondering if it is possible to bind 2 DbSets to one data grid view leveraging BindingList. public virtual DbSet<Candidate> Candidates { get; set; } = null!; public virtual DbSet<Candimmigration> Candimmigrations { get; set; } =…
Getting timeout exception on Count()
I am performing a query to the Customers table with some filters: var customers = Context.Customers .AsNoTracking() .Include(x => x.Client) .Include(x => x.CreatedByUser) …
UserId from 128 to 450 characters
During a migration from a project built with EF6 to EF Core 6 I noticed that in EF Core the AspNetUsers.Id column is now an nvarchar(450) while before it was an nvarchar(128). My models have a foreign key to the AspNetUsers table of nvarchar(128) and…
Map only the selected columns when using EntityFramework
In my recent Entity Core project I am having database table called "YmPlant" and it has 20+ columns. But for my requirement I just need data only from 3 columns. Also I am not required to do the write operations. Only read from YmlPlant table. …
broken .net framework aspnet webapi hosted on azure
Hello, I have a .net framework licensing server webapi app hosted on azure which has stopped working. It hasn't been used for a while, but when i came to update the keys, and use it again, i found it was broken. I wasn't able to get detailed logs…
The JSON value could not be converted to System.String. Path: $[1].Interests[1].Meta[9].Content | LineNumber: 0 | BytePositionInLine: 10073. Error
public Class Emp{ public string Name { get; set; } [Column(TypeName = "jsonb")] public List<Section> Sections { get; set; } } public Class Section{ public string Booking { get; set; } [Column(TypeName =…
IDisposable question
I have a class that implements an interface and also IDisposable: public interface IMyObject : IDisposable { void MyMethod(); } public class MyObject: IMyObject { public void MyMethod() { …
EF Core - updated data retrieve problem
Hello, I am trying to get updated data like this in my Blazor Server application: async Task PassiveDetail(OrderDetail orderDetail) { if (orderDetail == _detailToInsert) { _detailToInsert = null; …
How To Upload multiple pics At a time in Asp.net core razor pages and save It to Database?
Making a form in EF core Razor pages. I did the file uploading thing from below link reference .But I want to choose multiple JPEG file only at a time. What to change or implement In this code? upload-image-to-aspnet-razor-page.html This is the…
EF core 6.0 never working fine
I am coming to the conclusion that EF core is nothing but a bunch of bugs . I was correctly scaffolding a db until this morning . Now, without absolutely NO CHANGE in the DB schema and the scaffolding command , I realize that suddenly it…
Why ASP.NET Core 3.1 application installs Angular v8 on it's own?
Hi, I have been trying to create a simple CRUD app using Angular v12 (the latest version) and .NET Core 3.1. Whenever I try to create project in VS, it created project with Angular v8. So I installed Angular v12 globally. But still it uses Angular v8…
Guide line for Entity Framework & Entity Framework core data security
i have little knowledge of Entity Framework usage. mostly i work with Sql Helper ADO.Net based wrapper and it has no such data security related features. so what kind of data security features are there with EF & EF core ? please provide…
EF Core Generic Repository get Id from new inserted generic entity async
Goal: get id of the inserted generic entity by using async with ASP.NET Core 3 Problem: what part am I missing in order to achieve the goal? Code: public async Task<int> AddAsync(T entity) { if (entity == null) …