Пример #1
0
        public async Task <string> AddAffirmation(Affirmation affirmation)
        {
            var entity = DomainTranslator.TranslateToAffirmationEntity(affirmation);
            var result = await _AddEntity(entity, "Affirmations");

            return(result);
        }
Пример #2
0
        public async Task <string> AddTopic(Topic topic)
        {
            var entity = DomainTranslator.TranslateToTopicEntity(topic);
            var result = await _AddEntity(entity, "Topics");

            return(result);
        }
Пример #3
0
        public async Task <string> AddCategory(Category category)
        {
            var entity = DomainTranslator.TranslateToCategoryEntity(category);
            var result = await _AddEntity(entity, "Categories");

            return(result);
        }
Пример #4
0
        public async Task <bool> UpdateAffirmation(Affirmation affirmation)
        {
            var entity = DomainTranslator.TranslateToAffirmationEntity(affirmation);
            var result = await _UpdateEntity("Affirmations", entity);

            return(result);
        }
Пример #5
0
        public async Task <Topic> GetTopicByName(string topicName)
        {
            var entity = await _GetByValue <TopicEntity>("Topics", "Name", topicName.Trim());

            var result = entity != null
                                ? DomainTranslator.TranslateToTopic(entity)
                                : null;

            return(result);
        }
Пример #6
0
        public async Task <Subscriber> GetSubscriberByUsername(string username)
        {
            var entity = await _GetByValue <SubscriberEntity>("Subscribers", "Username", username);

            var result = entity != null
                                ? DomainTranslator.TranslateToSubscriber(entity)
                                : null;

            return(result);
        }
Пример #7
0
        public async Task <Subscriber> GetSubscriberById(string id)
        {
            var entity = await _GetById <SubscriberEntity>("Subscribers", id);

            var result = entity != null
                                ? DomainTranslator.TranslateToSubscriber(entity)
                                : null;

            return(result);
        }
Пример #8
0
        public async Task <Category> GetCategoryByName(string categoryName)
        {
            var entity = await _GetByValue <CategoryEntity>("Categories", "Name", categoryName.Trim());

            var result = entity != null
                                ? DomainTranslator.TranslateToCategory(entity)
                                : null;

            return(result);
        }
Пример #9
0
        public async Task AddSubmission(Submission submission)
        {
            var entity = DomainTranslator.TranslateToSubmissionEntity(submission);

            await _AddEntity(entity, "Submissions");
        }