Ejemplo n.º 1
0
        public static ProgramsResponse MapJsonDataResponseToProgramResponse(JsonDataResponse apiResponse)
        {
            ProgramsResponse programs = new ProgramsResponse();

            programs.response = new List <ProgramResponse>();
            foreach (List <string> programValues in apiResponse.Data)
            {
                ProgramResponse programResponse = new ProgramResponse()
                {
                    GenericType = programValues[0],
                    Id          = programValues[1],
                    IdChannel   = programValues[2],
                    Type        = programValues[3],
                    Title       = programValues[4],
                    Category    = programValues[5],
                    Description = programValues[6],
                    Score       = programValues[7],
                    Image       = programValues[8],
                    EpochStart  = programValues[9],
                    EpochEnd    = programValues[10]
                };
                programs.response.Add(programResponse);
            }

            return(programs);
        }
Ejemplo n.º 2
0
 public static Program ConvertProgramResponseToProgram(ProgramResponse response)
 {
     return(new Program()
     {
         GenericType = response.GenericType,
         Id = response.Id,
         Channel = new BE.Channel()
         {
             Id = response.IdChannel
         },
         Type = response.Type,
         Title = response.Title,
         Category = response.Category,
         Description = response.Description,
         Score = response.Score,
         Image = response.Image,
         EpochStart = response.EpochStart,
         EpochEnd = response.EpochEnd
     });
 }