using System.Collections.Generic; using System.Linq; using Luticate2.Utils.Dbo.Result; using Microsoft.Extensions.Options; using WebApiWebSem.DataAccess; using WebApiWebSem.Dbo; using WebApiWebSem.Dbo.Feed; namespace WebApiWebSem.Business { public class FeedBusiness { private readonly AppConfigDbo _options; private readonly FeedDataAccess _feedDataAccess; public FeedBusiness(IOptions options, FeedDataAccess feedDataAccess) { _options = options.Value; _feedDataAccess = feedDataAccess; } public LuResult> Get() { var feed = _feedDataAccess.Parse(_options.FeedUrl); return feed.To(dbos => (IList)dbos.Take(10).ToList()); } } }