代码首先在mvc5中进行逆向工程 [英] code first reverse engineering in mvc5

查看:78
本文介绍了代码首先在mvc5中进行逆向工程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨朋友们,我正在尝试使用代码第一个逆向工程概念来构建应用程序。为此我创建了一个名为codefirst的mvc5应用程序。在那个应用程序中,我添加了三层广告Bms.core,

Bms.Data

和Bms.Services





我添加了一个名为Customer with get的类文件,在Bms.core下设置属性。



我添加了一个名为ICustomer的接口一个方法名称,如IList< customer> ShowLIst()。





之后我不知道我在哪里实现列出数据的代码......





在Bms.Data中,我使用代码第一个逆向工程概念从db添加数据...

Hi friends, I am trying to build an application by using code first reverse engineering concept.. For that i created one mvc5 application named as codefirst. In that application i added three layers such ad Bms.core,
Bms.Data
and Bms.Services


I added one class file called Customer with get,set properties under Bms.core.

I added one Interface called ICustomer with one method name like IList<customer> ShowLIst().


After that I dont know Where i implement the code for listing the data...


In Bms.Data, I added the data from db using code first reverse engineering concepts...

推荐答案

在数据中你这样添加



In Data u add like this

public class RepositoryMap: EntityTypeConfiguration<RepositoryClass>
  {
      public RepositoryMap()
      {
          this.ToTable("TableNameInDB");
          this.HasKey(u => u.Id);
          this.Property(u => u.Name);
         
      }
  }


http://thedatafarm.com/data-access/quick-look-at-reverse-engineer-db-into-code-first -classes / [ ^ ]


这篇关于代码首先在mvc5中进行逆向工程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆