Пример #1
0
        public Payload<Topic> Get(string hashtag)
        {
            // create payload
            var payload = new Payload<Topic>();

            // todo: check security

            // prep
            // todo: add appending of # if necessary

            // get from db
            using (var queries = new TopicQueries())
            {
                payload.Data = queries.Get(hashtag);
            }

            // Check if null to add error
            if (payload.Data == null)
            {
                payload.Errors.Add("00002", Resources.Errors.ERR00002);
            }

            // return payload
            return payload;
        }
Пример #2
0
        public Payload<List<Topic>> Get()
        {
            // create payload
            var payload = new Payload<List<Topic>>();

            // todo: check security

            // get from db
            using (var queries = new TopicQueries())
            {
                payload.Data = queries.GetQuery().ToList();
            }

            // return payload
            return payload;
        }
Пример #3
0
        public Payload<List<Topic>> Search(string q)
        {
            // create payload
            var payload = new Payload<List<Topic>>();

            // todo: check security

            // get from db
            using (var queries = new TopicQueries())
            {
                payload.Data = queries.Search(q);
            }

            // Check if null to add error
            if (payload.Data == null)
            {
                payload.Errors.Add("00002", Resources.Errors.ERR00002);
            }

            // return payload
            return payload;
        }
Пример #4
0
        public Payload<List<Topic>> GetSubjects(int assetId)
        {
            // create payload
            var payload = new Payload<List<Topic>>();

            // todo: check security

            // get from db
            using (var queries = new TopicQueries())
            {
                payload.Data = queries.GetByAsset(assetId);
            }

            // return payload
            return payload;
        }