Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

EF Core Update Multiple tables of same structure based on condition

$
0
0

I have two tables Example:

table1:

ID Value

1 One

2 Two

table2:

ID Value

3 Three

4 Four

and have only one model

class values{publicint ID {get;set;}publicstring value{get;set;}}

How to I add two tables to modelbuilder so that when I call

var test = context.values.Where(m =>(m.ID ==3)).ToList();

It automatically returns three from table2


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>