Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 MVC4 中将部分类添加到实体优先定义的模型的约定是什么?或者至少,你是怎么做到的?
编辑:我的具体用例归结为有一个PowershellOperation需要实现的实体Execute()。
PowershellOperation
Execute()
约定是不扩展实体类。如果您有 PowershellOperation 实体,则它不应包含执行代码。我会创建专门的服务层类来处理 Execute 方法:
interface IPowershellOperationService { Execute(int id); } class PowershellOperationService : IPowershellOperationService { ...implement execute here... }