本文介绍了实体框架的插入,更新和删除操作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个主表

1.客户主包含
客户编号(PK)
客户名称

2. Location Master包含
LocationId(PK)
LocationName

还有另一个表,如

CustomerLocation包含
客户编号(FK)
LocationId(FK)

当我插入ADO.NET数据模型时,它将仅为Customer和Location表创建实体
如果我想在CustomerLocation表中插入数据.如何插入?
我有一张表格,其中包含两个下拉菜单,一个用于客户",另一个用于位置"
我必须将其插入到CustomerLocation表中的数据

我遵循存储库结构
因此,借助包含
的DataRepository文件 T Add(T实体);
void Update(T实体);方法
如果我想为CustomerLocation创建数据存储库,该如何创建.因为没有
实体模型.

帮帮我.我是存储库结构的新手.

I have Two master Tables

1. Customer Master contains
CustomerId (PK)
CustomerName

2. Location Master Contains
LocationId (PK)
LocationName

And another table like

CustomerLocation contains
CustomerId (FK)
LocationId (FK)

When i insert ADO.NET Data model it will create entity for Customer and Location table only
if i want to insert data in CustomerLocation table. How can i insert?
I have one form which contain two dropdown one for Customer and one for Location
with which i have to insert data in CustomerLocation Table

I follow Repository Structure
So, With the help of DataRepository file which contain
T Add(T entity);
void Update(T entity); methods
if i want to create data repository for CustomerLocation how can i create. Because there is no
entity model for that.

Help me for that. I am new for Repository Structure.

推荐答案



这篇关于实体框架的插入,更新和删除操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-30 03:40