Exemplo n.º 1
0
 public static T ToServiceModel <T>(this ModelInterface.IFixtureOverview model)
     where T : ServiceModel.FixtureOverview, new()
 {
     return(new T
     {
         Id = model.Id,
         IsStreaming = model.ListenerOverview != null && model.ListenerOverview.IsStreaming.GetValueOrDefault(),
         IsInErrorState = model.ListenerOverview != null && model.ListenerOverview.IsErrored.GetValueOrDefault(),
         StartTime = model.ListenerOverview != null
             ? model.ListenerOverview.StartTime.GetValueOrDefault()
             : DateTime.MinValue,
         Competition = model.CompetitionName,
         CompetitionId = model.CompetitionId,
         Description = model.Name,
         State = model.ListenerOverview != null
             ? MatchStatusToFixtureStateMapping[model.ListenerOverview.MatchStatus.GetValueOrDefault()]
             : ServiceModelInterface.FixtureState.Setup
     });
 }
Exemplo n.º 2
0
 public static ServiceModel.FixtureDetails ToServiceModel(this ModelInterface.IFixtureOverview model)
 {
     return(ToServiceModel <ServiceModel.FixtureDetails>(model));
 }