English 中文(简体)
2. 通用课程表
原标题:Generic ASP.NET MVC models, controllers and views

我目前正在评估伙伴关系。 NET MVC作为网络项目的可能技术。 我是伙伴关系的起点。 NET MVC 我需要一点意见。

我们目前有一个伙伴关系。 联网系统,使数据能够从使用臭氧消耗潜能值行的数据库和数据表检索。 这些数据是在一个网页上提供的,该网页使用的是使用数据库各栏的电网。 该系统是以通用方式建造的,由数据库驱动,以便我们不必撰写一个海关网页,显示数据库中的每个表。 我们实际上有一个伙伴关系。 数据库中用于制作和编辑不同表格的网络网页。

We are looking at rewriting the system using ASP.NET MVC. Is it possible to have generic models, controllers and viewers in ASP.NET MVC that use dictionaries or lists instead of having separate classes for each table in a database? On the controller side I have seen the following article to convert a data table to an IEnumerable:

https://stackovermission.com/问题3392612/con trans- datatable-to-ie amountablet”

However, I am not sure whether the same can be achieved on the model and viewer side. Is the whole idea of generic models, controllers and views perhaps contrary to the idea of ASP.NET MVC?

Regards Lucas

最佳回答

首先,如果你知道你会使用某种通用的物品,那么你就不需要对观点或控制者的习俗模式。

第二,你可以撰写编辑/显示模板,这些模板可以进行通用数据的工作,你可以将其用于你们的看法。

问题回答

我们正考虑利用伙伴关系对该系统进行重写。 NET MVC。 是否有可能在伙伴关系中建立通用模型、控制器和观众。 NET MVC:使用字典或清单,而不是在数据库中为每个表格单独开设课堂

通用解决办法常常是维持夜马术的极好办法。 他们的工作很顺利,直到你必须延长申请。 在我的经验中,如果你想做些什么,那么你不会偏离通用的解决办法,而是做小的工作。 接下来,你又做一个小的工作。 一年之后,你不想再次触及这一申请。

If that s not the case for you, congratulations! You can just use a DataTable as your model in the view.





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Transaction handling with TransactionScope

I am implementing Transaction using TransactionScope with the help this MSDN article http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx I just want to confirm that is ...

System.Web.Mvc.Controller Initialize

i have the following base controller... public class BaseController : Controller { protected override void Initialize(System.Web.Routing.RequestContext requestContext) { if (...

Microsoft.Contracts namespace

For what it is necessary Microsoft.Contracts namespace in asp.net? I mean, in what cases I could write using Microsoft.Contracts;?

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签