说我的IService拥有IRepository所具有的一切,以及更多的特定操作是正确的吗? 以下是代码: public interface IRepository<T>
{
T Add(T Entity);
T Remove(T Entity);
IQueryable<T> GetAll();
}
public interface IUserService
我需要一些建议,指出我的服务和存储库在哪里画线。 public class Contact
{
public Guid Id {get;set;}
public string Username {get;set;}
public Guid? AvatarId {get;set;}
public Avatar Avatar {get;set;}
}
p
我想为我的ASP.NET MVC 3应用程序使用服务层模式(如Martin Fowler's site here所述)。 我的目标是以一种方式设置解决方案结构,以便在挖掘代码之前通过设置适当的框架来更轻松地学习该模式。 任何人都可以向我展示在Visual Studio 2010解决方案中布局解决方案,项目和文件夹的常规方法吗?
我一直在使用下面的模式为我的控制器操作的控制器进行通信: public ActionResult Create(CreateViewModel model) {
if(!ModelState.IsValid) {
return View(model);
}
var project = new Project {
Name = model.Na
我有下面的类模型: public class Person
{
public string Name;
public int Age;
}
public class PersonService
{
public List<Person> GetAll() {...}
}
我被一个ObjectDataSource(ODS)绑定到GridView显示一个A