From 8e6c0efe488e87e8ef2179c78cb347a902d046d0 Mon Sep 17 00:00:00 2001 From: chsakell Date: Fri, 30 Sep 2016 12:22:16 +0300 Subject: [PATCH] rename match leauge to type --- Controllers/HomeController.cs | 2 +- Data/LiveGameDbInitializer.cs | 47 +++++++++++++--------- Models/Match.cs | 2 +- Models/MatchViewModel.cs | 3 +- app/home/home.component.html | 2 +- app/shared/components/match.component.html | 7 +++- app/shared/interfaces.ts | 2 +- 7 files changed, 38 insertions(+), 27 deletions(-) diff --git a/Controllers/HomeController.cs b/Controllers/HomeController.cs index 423c579..a967f86 100644 --- a/Controllers/HomeController.cs +++ b/Controllers/HomeController.cs @@ -25,7 +25,7 @@ namespace ChatLe.Controllers { TimerEventArgs eventsArgs = e as TimerEventArgs; System.Diagnostics.Debug.WriteLine("hello from home ApiHubController.cs.."); - await Clients.All.userConnected(DateTime.Now); + //await Clients.All.userConnected(DateTime.Now); //_coolMessageHubContext.Clients.All.newCpuValue(eventsArgs.Value); } } diff --git a/Data/LiveGameDbInitializer.cs b/Data/LiveGameDbInitializer.cs index b7f45aa..e420bc0 100644 --- a/Data/LiveGameDbInitializer.cs +++ b/Data/LiveGameDbInitializer.cs @@ -24,48 +24,57 @@ namespace LiveGameFeed.Data { Host = "Team 1", Guest = "Team 2", - HostScore = 3, - GuestScore = 1, + HostScore = 0, + GuestScore = 0, MatchDate = DateTime.Now, - League = "FootballLeauge", + Type = "Football", Feeds = new List { new Feed() { Description = "Match started", MatchId = 1 - }, - new Feed() - { - Description = "Goal for Panathinaikos", - MatchId = 1 - }, + } } }; + Match match_02 = new Match { Host = "Team 3", Guest = "Team 4", - HostScore = 5, - GuestScore = 3, + HostScore = 0, + GuestScore = 0, MatchDate = DateTime.Now, - League = "Spanish League", + Type = "Football", Feeds = new List { new Feed() { Description = "Match started", MatchId = 2 - }, - new Feed() - { - Description = "Goal for Real Madrid", - MatchId = 2 - }, + } } }; - context.Matches.Add(match_01); context.Matches.Add(match_02); + Match match_03 = new Match + { + Host = "Team 5", + Guest = "Team 6", + HostScore = 0, + GuestScore = 0, + MatchDate = DateTime.Now, + Type = "Basketball", + Feeds = new List + { + new Feed() + { + Description = "Match started", + MatchId = 3 + } + } + }; + + context.Matches.Add(match_01); context.Matches.Add(match_02); context.Matches.Add(match_03); context.SaveChanges(); } diff --git a/Models/Match.cs b/Models/Match.cs index 39387ce..90cfce9 100644 --- a/Models/Match.cs +++ b/Models/Match.cs @@ -15,7 +15,7 @@ namespace LiveGameFeed.Models public int HostScore { get; set; } public int GuestScore { get; set; } public DateTime MatchDate { get; set; } - public string League { get; set; } + public string Type { get; set; } public ICollection Feeds { get; set; } } diff --git a/Models/MatchViewModel.cs b/Models/MatchViewModel.cs index 8bff433..97ed78a 100644 --- a/Models/MatchViewModel.cs +++ b/Models/MatchViewModel.cs @@ -1,5 +1,4 @@ using System; -using System.Collections.Generic; namespace LiveGameFeed.Models { @@ -11,6 +10,6 @@ namespace LiveGameFeed.Models public int HostScore { get; set; } public int GuestScore { get; set; } public DateTime MatchDate { get; set; } - public string League { get; set; } + public string Type { get; set; } } } diff --git a/app/home/home.component.html b/app/home/home.component.html index cea8b66..b0ba090 100644 --- a/app/home/home.component.html +++ b/app/home/home.component.html @@ -1,5 +1,5 @@
-
+
\ No newline at end of file diff --git a/app/shared/components/match.component.html b/app/shared/components/match.component.html index 7c7e21c..4b89ae8 100644 --- a/app/shared/components/match.component.html +++ b/app/shared/components/match.component.html @@ -15,8 +15,11 @@ {{match.guestScore}} - - diff --git a/app/shared/interfaces.ts b/app/shared/interfaces.ts index 9fa649d..d82cffc 100644 --- a/app/shared/interfaces.ts +++ b/app/shared/interfaces.ts @@ -27,6 +27,6 @@ export interface Match { hostScore: number; guestScore: number; matchDate: Date; - league: string; + type: string; feeds: any } \ No newline at end of file