Should you use a partial class across projects?

后端 未结 8 488
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-03 16:42

I have a class library with all my database logic. My DAL/BLL.

I have a few web projects which will use the same database and classes, so I thought it was a good

8条回答
  •  独厮守ぢ
    2020-12-03 17:26

    You can't write a partial class across projects. A partial class is a compile-time-only piece of syntactic sugar - the whole type ends up in a single assembly, i.e. one project.

    (Your original DAL file would have to declare the class to be partial as well, by the way.)

提交回复
热议问题