业务层有80%的代码就是再次包装dal层。软件开发就是不断得消灭重复提高重用。 有个牛人说过:消灭重复的最好办法就是不断的抽象。

    我以前有一篇文章  关于 Repository 在BIZ层的应用  曾经就有了这个想法,但是一直没有实践,直到现在我才发现,当初的这个想法实在太棒了。它也适用于Web Form。

1.来看一下IBaseBiz.cs

interface IBaseBiz<T>
{
    T Get(object id);
    IQueryable<T> FindAll();
    bool IsExists(Expression<Func<T, bool>> predicate);
    void Add(T entity);
    void Add(List<T> entitys);
    void Delete(T entity);
    void Delete(List<T> entitys);
    void Delete(Expression<Func<T, bool>> predicate);
}

相关文章:

  • 2021-04-13
  • 2021-12-07
  • 2021-12-24
  • 2021-06-01
  • 2022-01-08
  • 2021-07-02
猜你喜欢
  • 2021-10-12
  • 2021-11-28
  • 2021-12-15
  • 2021-07-13
  • 2021-06-02
  • 2021-07-20
相关资源
相似解决方案