创建一个c#函数 [英] Creating a c# function

查看:239
本文介绍了创建一个c#函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建一个3层架构的网站。它已经差不多完成了,但现在我需要在其中添加另一个功能。添加功能的更好方法是什么,我应该放在哪里,要么定义功能在所有的地方,根据其他功能或有任何其他方式来做它?

I am creating a website in 3 layer architecture.It's almost completed but now i have a requirement to add another functionality in to it.What's the better way to add a function and where should i place it,either I define the function in all the places as per the others functions or is there any other way around to do it?

推荐答案

你已经做了3级,我建议你保持这一点。



是的,如果你想添加一个新功能,那么在每个层中定义它并从Page调用业务层功能,然后从业务层调用数据访问层功能。这很简单。



该函数应该连接到数据库并检索数据访问层中的数据,这将返回到业务层。然后你必须根据业务逻辑操作它并返回主 aspx 页面。
As you have already done 3 Tier, I would suggest you to maintain that.

Yes, if you want to add a new function, then define it in every Tier and call Business Layer function from Page, then call Data Access Layer function from Business Layer. It is very simple.

And the function should connect to Database and retrieve the data in Data Access Layer, which will return that to Business Layer. Then you have to manipulate that as per your Business logic and return to the main aspx page.


您想要执行哪些操作。

如果您想添加业务逻辑,可以将您的功能代码放在第二层。业务层。
What operations do you want to perform.
If you want to add business logic you can put your function code in 2nd Layer.i.e Business Layer.


这篇关于创建一个c#函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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