C# 我在哪里可以找到一个好的示例 ASP.NET 数据库驱动的 Web 应用程序?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/354775/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-04 00:16:45  来源:igfitidea点击:

Where can I find a Good Sample ASP.NET Database Driven Web Application?

c#asp.netdatabase

提问by Raj Rao

I would like to learn the best practices to employ when creating a database driven web-application. I prefer to learn from examples. What is a good sample application that I can download and run to learn this:

我想学习在创建数据库驱动的 Web 应用程序时采用的最佳实践。我更喜欢从例子中学习。什么是好的示例应用程序,我可以下载并运行以了解这一点:

I am looking for:

我在寻找:

  1. Should be written in C# (preferably)
  2. Should contain a complex database design (parent child relations, etc.)
  3. Should implement the best practices for an ASP.net website as well as for database design.
  4. Preferably uses Oracle.
  1. 应该用 C# 编写(最好)
  2. 应该包含复杂的数据库设计(父子关系等)
  3. 应该为 ASP.net 网站以及数据库设计实施最佳实践。
  4. 最好使用 Oracle。

采纳答案by George Stocker

If you don't want to worry about writing your DAL(Data Access Layer), then I suggest looking at Nhibernate. There are samples with it and ASP.NET here, here, and here. Here's a sample with just Oracleand ASP.NET.

如果您不想担心编写DAL(数据访问层),那么我建议您查看Nhibernate此处此处此处提供了有关它和 ASP.NET 的示例。这是一个仅包含 Oracle和 ASP.NET的示例

If you are looking for just sample ASP.NET Applications without an Object Relational Mapper like NHibernate, try this.

如果您只是在寻找没有像 NHibernate 这样的对象关系映射器的示例 ASP.NET 应用程序,请试试这个

Also, on a higher level, you're looking for an N-Tier ASP.NET application design. There are good tutorials on that here, here, and here.

此外,在更高级别上,您正在寻找N 层 ASP.NET 应用程序设计。在这里这里这里有很好的教程。

回答by Joshua Hudson

For 1 through 3, I would recommend downloading some of the ASP.NET starter kits. I'm not sure if they work with Oracle though.

对于 1 到 3,我建议下载一些 ASP.NET 入门工具包。我不确定他们是否与 Oracle 合作。

Some of the bigger frameworks are also great starts like DotNetNuke. They make great use of best practices.

一些更大的框架也是很好的开始,比如 DotNetNuke。他们充分利用了最佳实践。

http://www.asp.net/community/projects/

http://www.asp.net/community/projects/

回答by Michael Kniskern

For Oracle, look for samples using the System.Data.OracleClient.

对于 Oracle,查找使用 System.Data.OracleClient 的示例。

回答by NotMyself

Writing this from my iPhone so sorry for the brvity.

用我的 iPhone 写这篇文章,为简洁而感到抱歉。

Check out rob conrey's MVC storefront videos & source.

查看 rob conrey 的 MVC 店面视频和来源。

回答by domusvita

There are lots of examples in ASP.NET StarterKits. I really like the BlogEngine.NETapplication. For higher-end basics (hmmm..."higher-end basics"...oxymoron?) the BeerHouse E-Commerce applicationis great.

ASP.NET StarterKits 中有很多示例。我真的很喜欢BlogEngine.NET应用程序。对于高端基础知识(嗯...“高端基础知识”...矛盾?)BeerHouse 电子商务应用程序很棒。

回答by Kirk

In my opinion best practice would dictate the following:

在我看来,最佳实践将规定以下内容:

  1. Use an ORM for your data access layer. This should ideally be in a a separate project so it can be changed if need be.
  2. Should use MVC. If you use WebForms then you will surely find that your business logic and the display logic gets mixed together.
  3. Learn database design separate and apart from learning to write code.
  4. Keep reviewing object oriented design fundamentals.
  5. Take time to learn design patterns. Not to become a slave to "The Gang of Four" but so that you can take advantage of proven patterns to solve common problems.
  1. 为您的数据访问层使用 ORM。理想情况下,这应该在一个单独的项目中,以便可以在需要时进行更改。
  2. 应该使用MVC。如果您使用 WebForms,那么您肯定会发现您的业务逻辑和显示逻辑混合在一起。
  3. 与学习编写代码分开学习数据库设计。
  4. 不断复习面向对象的设计基础。
  5. 花时间学习设计模式。不要成为“四人帮”的奴隶,而是要利用经过验证的模式来解决常见问题。