Пример #1
0
        /// <summary>
        /// Adds a request to the current repository.
        /// </summary>
        /// <param name="request">A new request.</param>
        public void Add(FriendshipRequest request)
        {
            ContractUtil.NotNull(request);
            ContractUtil.IsDefault(request.Id);


            Set.Add(request);
        }
Пример #2
0
            /// <summary>
            /// Adds a request to the current repository.
            /// </summary>
            /// <param name="request">A new request.</param>
            public void Add(FriendshipRequest request)
            {
                ContractUtil.NotNull(request);
                ContractUtil.IsDefault(request.Id);

                var key = GetNewKey();

                request.Id = key;
                _data.Add(key, request);
            }
Пример #3
0
            /// <summary>
            /// Adds a post to the current repository.
            /// </summary>
            /// <param name="post">The post to add.</param>
            public void Add(Post post)
            {
                ContractUtil.NotNull(post);
                ContractUtil.IsDefault(post.Id);

                var key = GetNewKey();

                post.Id = key;
                _data.Add(key, post);
            }
Пример #4
0
            /// <summary>
            /// Adds a given notification to the current repository.
            /// </summary>
            /// <param name="notification">The notification to add.</param>
            public void Add(Notification notification)
            {
                ContractUtil.NotNull(notification);
                ContractUtil.IsDefault(notification.Id);

                var id = GetNewKey();

                notification.Id = id;
                _data.Add(id, notification);
            }
Пример #5
0
            /// <summary>
            /// Adds a message to the current repository.
            /// </summary>
            /// <param name="message">The message to add.</param>
            public void Add(Message message)
            {
                ContractUtil.NotNull(message);
                ContractUtil.IsDefault(message.Id);

                var key = GetNewKey();

                message.Id = key;
                _data.Add(key, message);
            }
Пример #6
0
            /// <summary>
            /// Adds a new user to the current repository.
            /// </summary>
            /// <param name="user">The new user to add.</param>
            public void Add(User user)
            {
                ContractUtil.NotNull(user);
                ContractUtil.IsDefault(user.Id);


                var keyword = Container.Instance.Resolve <IKeyGenerationService>().CreateKey(user); // TODO: Maybe inject dependency through the constructor

                user.Keyword = keyword;

                var key = GetNewKey();

                user.Id = key;
                _data.Add(key, user);
            }