Trying to map Many to Many in EF Core
HiI am trying to map modela to modelb i have a model ab table, and I have fluent api setup in a different class using IEntityTypeConfigurationmy code looks likepublic class ABModelConfiguration :...
View ArticleIs a ViewModel a Domain Model?
Hi Friends,I was wondering is a ViewModel synonymous with a Domain Model. If not then how do they differ. I was also wanting some clarity involving what is domain driven design. Thanks !
View ArticleThe property 'Key' is part of the object's key information and cannot be...
Hi There; I am writing a software and I have a problem that I cannot figure out. I have used inheritance in my project and Table per Hierarchy. I have an abstract classA. I have a concrete class B that...
View ArticleCan someone have any idea of how can I have SQL Timeout in about 50ms on Linq...
I have a Web Service (that is consumed) to just check in a single table if a RecID exist, there is a index for such column. It uses Linq To SQL query, where default connection timeout is 30 seconds....
View ArticleHow do you implement chain of responsibility pattern in Entity Framework?
If you are using entity framework would you create separate classes/tables for different Employees and Managers? Or a single table with a flag ?I am a bit confused as to what would be the better...
View ArticleChange the output format of the var variabale
I have a method to check the duplicate in the column of a DataTable.public void ChkDuplicacy(DataTable dt) { try { var dup_result = from c in dt.AsEnumerable()group c by new { RowId =...
View ArticleHow to show a PartialView with Model "With null model"
Hi all,I have a PartialView which I want to show in a View like the below code and I want to show it empty at the load of the page (View).Then using Jquery I will call it again and fill it when ever I...
View ArticleRe: Blazor - Scaffold-DBContext issues?
Not sure if I need to start a new conversation but I am also having issues with trying to use Scaffold-DBContext.My issue is a bit different. I have not even gotten to the database connection part...
View Article.NET Core C# Table Joins and Query Strings
I am fairly new to .NET Core and have been working with some Microsoft YouTube videos to create a new API .NET Core project.In the process I discovered Scaffold-DbContext. I was successful in getting...
View ArticleHow to delete child from children collection of parent in EF core? (removing...
I have a parent table and an associated child table in a one-to-many relationship. I need a solution for deleting specific items from the child table when modifying the collection of the parent....
View Articlea quick table question
HiI have a table in which has two main fields, then it has over 100 nullable foriegn keys which will only link to 1 other table at a time.Is this ok?I could turn it into lots of many to many's, which...
View ArticleOrderBy Array using Lambda Expression
Hi All,I am referring my previous post which worked initially but due to other format it failed to do descending orderhttps://forums.asp.net/t/2151397.aspx?StringBuilder+sorting+ string[] allRows =...
View ArticleEager loading goes into "hyperloop" in EFCore and .Net Core Web API, Generic...
Am trying to fetch data in a .Net Core Web API using eager loading on a many to many relationship. But when i inspect the the point where i set the breakpoint in a Get method, i see an endless fetch of...
View ArticleHow do I use Multiple DBContext in my Controller Class
I have a controller class called SearchController.csI have a DBContext call to my a SQL Database inside the controller:namespace Rescue.Exchange.API.Controllers { [AllowAnonymous] //This controller...
View ArticleHow to selectmany for enum?
Say for example I have this enumpublic enum Suit { Diamonds, Clubs, Hearts, Spades }How do I use LINQ selectmany to loop my enum four times?This is version below is not in enum but my version, the Suit...
View ArticleChange index values, get "Cannot insert duplicate key"
I am changing only the values of an index field (ListIndex). There are no duplicates yet when I SaveChanges I get:System.Data.SqlClient.SqlException: Cannot insert duplicate key row in object...
View ArticleFather I have sinned (against SOLID) or did I?
Hi all,I am using this link IQueryable<Evraklar> BulunanEvraklar = _context.NumuneDetaylari.Where(e => e.KulakNo.Contains(ArananDeger)).Include(e => e.Evraklar).Select(e =>...
View ArticleUnable to determine the relationship represented by navigation property
Unable to determine the relationship represented by navigation property 'ApplicationUser.Groups' of type 'List<Groups>'. Either manually configure the relationship, or ignore this property using...
View ArticleUpdate multistep wizard data in not strongly typed view
hello allin my mvc project, i have implemented a not strongly typed form with multi steps wizard view, for create and update object in database by entity framework.for create an object , i have stored...
View ArticleLinq EF query question
Hello everyone,I have a web api rest service. I am trying to linq query and retrieve data but somehow coupons is null. Here is my sample linq:var codeBankResult = await (context.CodeBanks.Where(c =>...
View Article