using System.Collections.Generic; using System.Threading.Tasks; using SharpRss.Models; namespace SharpRss.Services { /// /// Managing RSS feeds and categories. /// public class RssService { public RssService() { _dbService = new DatabaseService(); Initialize(); } private readonly DatabaseService _dbService; private async void Initialize() { //HashSet categoryModels = await _dbService.GetCategoriesAsync(); } public async Task> GetAllAsync() { HashSet items = new HashSet(); return items; } public async Task> GetCategoriesAsync() { return new HashSet(); } public async Task> GetFeedsAsync(CategoryModel? categoryModel = null) { HashSet feeds = new HashSet(); if (categoryModel != null) { // Get feeds from the category. } else { // Get all the feeds. } return feeds; } public async void AddCategoryAsync(string name) { } public async void AddFeedAsync(string rssUrl) { } /*private static HashSet feedSet = new HashSet() { new FeedModel("http://fedoramagazine.org/feed/"), new FeedModel("https://www.nasa.gov/rss/dyn/breaking_news.rss"), }; private static HashSet feedSet2 = new HashSet() { new FeedModel("https://journals.plos.org/plosone/feed/atom"), new FeedModel("https://itsfoss.com/feed") };*/ /*HashSet set = new HashSet() { new CategoryModel("RSS", feedSet), new CategoryModel("Tech", feedSet2) };*/ } }