Example #1
0
        public IHttpActionResult Get(string token, Guid identifier)
        {
            if (auth.IsNotValid(token))
            {
                return(base.StatusCode(System.Net.HttpStatusCode.Unauthorized));
            }

            if (Guid.Empty == identifier)
            {
                return(this.BadRequest("identifier"));
            }

            var search = new ConversationSearch()
            {
                UserIdentifier = auth.Device.UserIdentifier,
                Identifier     = identifier
            };

            var results = conversation.Search(search);

            results = from r in results
                      orderby r.On
                      select r;

            return(this.Ok <IEnumerable <Comment> >(results));
        }
Example #2
0
        public IHttpActionResult My(string token)
        {
            if (auth.IsNotValid(token))
            {
                return(base.StatusCode(System.Net.HttpStatusCode.Unauthorized));
            }

            var search = new ConversationSearch()
            {
                UserIdentifier = auth.Device.UserIdentifier,
            };

            return(this.Ok <IEnumerable <Comment> >(conversation.Search(search)));
        }
Example #3
0
        public IEnumerable <Comment> Search(ConversationSearch search)
        {
            if (null == search)
            {
                throw new ArgumentNullException("search");
            }

            var proc = new SocialSearchConversation()
            {
                Identifier     = search.Identifier.ToNullable(),
                UserIdentifier = search.UserIdentifier,
            };

            return(proc.CallObjects <Comment>());
        }
Example #4
0
        public IEnumerable <Comment> Search(Guid?identifier = null)
        {
            var search = new ConversationSearch()
            {
                UserIdentifier = User.Identifier(),
                Identifier     = identifier.HasValue ? identifier.Value : Guid.Empty,
            };

            var results = conversation.Search(search);

            if (identifier.HasValue)
            {
                results = from r in results
                          orderby r.On
                          select r;
            }

            return(results);
        }