Repository模式的理解

Repository模式的理解

本文介绍了ASP.NET MVC和放大器; Repository模式的理解的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我非常新的ASP.NET MVC和界面设计。我一直在问了很多问题,并阅读了大量文章试图使这一切的感觉。由于在工作中的危机,我一直呼吁尽我所能,学习这样的环境。虽然它一直令人沮丧的把握,我慢慢变了。

So I'm extremely new to ASP.NET MVC and Interface design. I've been asking a lot of questions and reading a lot of articles trying to make sense of it all. Due to a crisis at work, I have been called upon to do my best and learn this environment. And although it's been frustrating to grasp, I am slowly getting it.

我创建在Photoshop的图像,显​​示我的存储库模式是如何工作的,以及为什么这是非常推荐的基本的了解。我试图部署在工作中这种模式,我想确保我得到的要点

I have created an image in photoshop that shows my basic understanding of how the Repository Pattern works and why it's very much recommended. I'm trying to deploy this pattern at work and I want to make sure I get the major points

我请你指出任何明显的(而不是肛门或无关的)错误......我希望不会有任何。

I ask you to point out any glaring (not anal or unrelated) mistakes... I hope there aren't any.

推荐答案

这是pretty大同小异的模式我跟随。它也类似于由由Scott Hanselman在书面申请中使用的模式。

This is pretty much the same pattern I follow. Its also similar to the pattern used by the nerddinner application written by Scott Hanselman.

我会做的唯一的变化是你的控制器和存储库之间增加一个服务层。这将帮助你避免这被认为是不好的做法是胖的控制器。

The only change I would make is to add a service layer between your controller and repository. This will help you avoid having a "fat" controller which is considered bad practice.

这篇关于ASP.NET MVC和放大器; Repository模式的理解的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 22:30