开发者

Asp.net MVC 2 Multilang Database Model and View

I need to create a multilang mvc application.

My Database Design tablei is

Table : Group

GrpID : Int PK

IsActive : Bit

Ta开发者_开发知识库ble : GroupDetail

GrpID : Int FK

GrpText : Nvarchar(200)

LangID : Int

Question 1

How can I have this view Result.

Francais   English

Auto         Car

Chien       Dog

Thanks all


It looks that you already have a database design. The first thing is to decide how are you going to access this database. You have many choices here. For example you could use an ORM such as NHibernate or Linq to Entities. If you think that using an ORM for such a simple database schema would be an overkill you could also resort to plain ADO.NET and write the SQL queries yourself. Even in this case it is recommended to setup an object model that will reflect your database schema.

The next step is to write the data access layer. Usually this consists of two parts: an abstraction (interface) and implementation (concrete class) for a given data access technology you picked up in the first step.

Then you write a controller that will talk to this repository and fill a view model. This view model is then passed to the view to be displayed.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜