コード例 #1
0
        public IDataResult <Subscriber> GetById(int id)
        {
            IResult result = BusinessRule.Run
                             (
                CheckIfSubscriberExist(id)
                             );

            if (result != null)
            {
                return(new ErrorDataResult <Subscriber>(result.Message));
            }

            return(new SuccessDataResult <Subscriber>(_subscriberDal.Get(s => s.Id == id)));
        }
コード例 #2
0
        public bool GetIsUserSubs(int channelId, int userId)
        {
            var result = _subscriberDal.Get(subs => subs.UserId == userId && subs.ChannelId == channelId);

            return(result != null);
        }