Exemple #1
0
        public static ICommentSubscribtion RemoveCommentSubscribtion(this IStory forStory, IUser byUser)
        {
            Check.Argument.IsNotNull(forStory, "forStory");
            Check.Argument.IsNotNull(byUser, "byUser");

            var subscribtion = forStory.GetCommentSubscribtion(byUser);

            if (subscribtion != null)
            {
                IoC.Resolve <ICommentSubscribtionRepository>().Remove(subscribtion);
            }
            return(subscribtion);
        }
Exemple #2
0
        public static ICommentSubscribtion AddCommentSubscribtion(this IStory forStory, IUser byUser)
        {
            Check.Argument.IsNotNull(forStory, "forStory");
            Check.Argument.IsNotNull(byUser, "byUser");

            var subscribtion = forStory.GetCommentSubscribtion(byUser);

            if (subscribtion == null)
            {
                subscribtion = IoC.Resolve <IDomainObjectFactory>().CreateCommentSubscribtion(forStory, byUser);
                IoC.Resolve <ICommentSubscribtionRepository>().Add(subscribtion);
            }
            return(subscribtion);
        }