12345678910111213141516171819202122232425262728 |
- 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<AppConfigDbo> options, FeedDataAccess feedDataAccess)
- {
- _options = options.Value;
- _feedDataAccess = feedDataAccess;
- }
-
- public LuResult<IList<FeedDbo>> Get()
- {
- var feed = _feedDataAccess.Parse(_options.FeedUrl);
- return feed.To(dbos => (IList<FeedDbo>)dbos.Take(10).ToList());
- }
- }
- }
|