存储库或业务逻辑问题?
我的服务方法正在接收消息作为参数。此消息具有相同的 props。该属性用于为查询构建过滤器。可以使用一些逻辑。
设置过滤器的代码可能看起来像这样
var filter = new QueryFilter()
var predicate = new Predicate()
if(message.Param1 == 1)
{
predicate .Param1 == message.Param2 + 5;
}
filer.Addpredicate(predicate);
我的问题是,这段代码应该在存储库中还是这是一个业务逻辑问题?
My service method is receiving a message as parameter. This message has same props. This props are used to build a filter for a query. There could be used some logic.
The code which is setting up the filter may looks like this
var filter = new QueryFilter()
var predicate = new Predicate()
if(message.Param1 == 1)
{
predicate .Param1 == message.Param2 + 5;
}
filer.Addpredicate(predicate);
My question is,should be this code in the repository or is this a bussines logic concern ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这应该不那么重要,但既然你有“查询”这个词,它主要与存储相关,我会说 - 存储库
It shouldn't matter that much, but since you have the word "query", which is mostly storage-related, I'd say - the repository