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) …
Xamarin and. Net 6
Hello, is it possible to use. Net 6 in Xamarin Forms (not MAUI)? I have an existing app for Android, where I would like to use EF core 6, but that requires. Net 6. I couldn't find any related info on the web, it was always about MAUI & net 6. …
EF core scaffolding di un database esistente
Sto facendo un programma che legge le estrazioni del Lotto dalle varie ruote .. Il database contiene tante tabelle quante sono le ruote, ognuna chiamata "Estrazione_"+ Nome ruota (es. "Estrazione_Roma",…
EF Core Alter Column size automatically
Is there any way, to resize the column to the needed length in runtime automatically? for example: the column is a nvarchar(50), but the value to insert has a length of 80. Is it now possible to alter the column to nvarchar(80) by EF Core…
Divide by Zero Exception inside of a Linq Join Condition
Give the example below, I'm getting a Divide by Zero exception error. Can you please advise me how to set the Result value to zero if the data in field test1 is zero? I can't use at "try catch" of "if statement" because the code…
Test Internal Server Error Message : The operation was canceled.
I am trying to figure out why I am getting the "Test Internal Server Error Message : The operation was canceled." intermittently on only one of our client environments(on Prem), This basically happens when we are trying to interservice http…
How to set text encoding on a data column from EntityFramework or ADO.NET?
I have a native C++ Windows MFC application that accesses sqlite3.dll to load data from a database and it loads non-ASCII characters like 'ñ' without changing them to '?' When I access this database from EntityFramework, the non-ASCII characters get…
Entity Framework for netcoreapp 3.1
I want to write a simple Desktop WinForms application using Entity Framework to access Data . My project file's contante is as follows : <Project Sdk="Microsoft.NET.Sdk.WindowsDesktop"> <PropertyGroup> …
foreach loop getting first record every time while iterate in .Net core dbcontext
hi please check above image I have attached debugger also . here getting order id based on orderheaderList . the orderdetails while first time getting data properly (i.e., orderid=11141) after that loop getting different orderid but…
Application development in Solaris using .NET core. Is this possible?
I just started to show some interest towards, Solaris Operating system. Is .NET core made compatible with this OS? can anyone guide. Though I am aware that using VS 2022 Linux,Mac OS is compatible. But particular Solaris not sure.
Npgsql.PostgresException (0x80004005): 42P01: relation "ProductImages" does not exist
Hey Guys. I am trying to read a list of products from the db using entity framework core. Works on local environment but fails in production on heroku. my db is in postgres It happens when i try to "Include" the products images …
Linq Group By Question
Hi, I am trying to group my entities based on vendor id. I couldn't figure out how to sum values. Here is my query so far. var result1 = from order in Orders from orderdetail in OrdersDetails from…
EF Core 6 master-detail how to retrieve only matching values
Hello there, I have Orders and OrdersDetail entities. SET IDENTITY_INSERT [dbo].[Orders] ON INSERT INTO [dbo].[Orders] ([Id], [OrderDateTime], [Status], [DoneBy], [CustomerId]) VALUES (12, N'2022-08-25 12:09:33', N'Continues', N'Cenk', 5) …
DirectoryNotFoundException While Trying To Uplode Any File In EF core Razor Pages
I am Trying To make A form In Ef core Razor pages where I have to upload Salary slip and save it in DB. My Entity Class Is public class SalarySlip { public int Id { get; set; } //Later It will be a dropdown…
Entity Framework tools - Azure DevOps Warning
I have an Azure Devops (on-premises) issue. I am getting the following warning the 'Migrations script' pipeline step: 'The Entity Framework tools version '6.0.5' is older than that of the runtime '6.0.6'. Update the tools for the latest…
How to Use EF Dependency Injection with Called Method
Hello everyone and thanks for the help in advance. Attempting to learn dependency injection concepts with C# and MVC controller. I am reading through the article https://learn.microsoft.com/en-us/ef/core/dbcontext-configuration/. My question is, let's…
DbContext OnConfiguring(optionsBuilder) has optionsBuilder.IsConfigured == false although private member of class Program builds options....
The call to DbContext.OnConfiguring receives an instance of DbContextOptionsBuilder called optionsBuilder which has its property IsConfigured equal to false... It should be equal to true since in the Program class we set the optionsBuilder to…
Data Transfer Objects
I just have a quick question concerning DTO's. I read that DTO's are useful for security purposes e.g. they prevent you from sending confidential data across the network. But the tutorial also said that DTO's are also useful in the case that if there…
Duende IdentityServer - USers in Role throws error
Just trying to get a list of the Users in a specific Role - var users = await _userManager.GetUsersInRoleAsync("Administrators"); return null; Throws System.NotSupportedException: Serialization and deserialization of 'System.Action'…