开发者

Repository or Business logic concern?

开发者 https://www.devze.com 2023-01-31 23:48 出处:网络
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.

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 ?


It shouldn't matter that much, but since you have the word "query", which is mostly storage-related, I'd say - the repository

0

精彩评论

暂无评论...
验证码 换一张
取 消