From cc3b7fbbc56576272c7f8ff15bc81dfcaff8283b Mon Sep 17 00:00:00 2001 From: chsakell Date: Tue, 4 Oct 2016 11:27:03 +0300 Subject: [PATCH] move FeedEngine to its own class --- Core/FeedEngine.cs | 23 +++++++++++++++++++++++ Core/FeedGenerator.cs | 25 ------------------------- Startup.cs | 17 +---------------- 3 files changed, 24 insertions(+), 41 deletions(-) create mode 100644 Core/FeedEngine.cs delete mode 100644 Core/FeedGenerator.cs diff --git a/Core/FeedEngine.cs b/Core/FeedEngine.cs new file mode 100644 index 0000000..545f961 --- /dev/null +++ b/Core/FeedEngine.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using LiveGameFeed.Models; +using Microsoft.Extensions.Logging; +using RecurrentTasks; + +namespace LiveGameFeed.Core +{ + public class FeedEngine : IRunnable + { + private ILogger logger; + + public FeedEngine(ILogger logger) + { + this.logger = logger; + } + public void Run(TaskRunStatus taskRunStatus) + { + var msg = string.Format("Run at: {0}", DateTimeOffset.Now); + logger.LogDebug(msg); + } + } +} \ No newline at end of file diff --git a/Core/FeedGenerator.cs b/Core/FeedGenerator.cs deleted file mode 100644 index ee93157..0000000 --- a/Core/FeedGenerator.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System; -using System.Collections.Generic; -using LiveGameFeed.Models; - -namespace LiveGameFeed.Core -{ - public class FeedGenarator - { - public static Feed UpdateScore(Match match) { - Feed feed = new Feed(); - feed.MatchId = match.Id; - - if(match.Type == MatchTypeEnums.Football) - { - - } - else if (match.Type == MatchTypeEnums.Basketball) - { - - } - - return feed; - } - } -} \ No newline at end of file diff --git a/Startup.cs b/Startup.cs index 0b58ef0..7390016 100644 --- a/Startup.cs +++ b/Startup.cs @@ -15,6 +15,7 @@ using LiveGameFeed.Core.Mappings; using LiveGameFeed.Core.MvcTimer; using Newtonsoft.Json.Serialization; using RecurrentTasks; +using LiveGameFeed.Core; namespace LiveGameFeed { @@ -92,20 +93,4 @@ namespace LiveGameFeed app.StartTask(TimeSpan.FromSeconds(15)); } } - - public class FeedEngine : IRunnable - { - private ILogger logger; - - public FeedEngine(ILogger logger) - { - this.logger = logger; - } - - public void Run(TaskRunStatus taskRunStatus) - { - var msg = string.Format("Run at: {0}", DateTimeOffset.Now); - logger.LogDebug(msg); - } - } }