Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- namespace ConsoleApplication1
- {
- using System.Collections.Generic;
- class Program
- {
- static void Main(string[] args)
- {
- var allguids = new List<Guid>();
- for (var i = 0; i < 10; i++)
- {
- allguids.Add(Guid.NewGuid());
- }
- var requestInfo = new RequestInfo() { VideoIDs = allguids.ToArray() };
- var clipVideos = allguids.Take(5).Select(guid => new ClipVideo() { ClipVideoKey = guid }).ToList();
- var ve = new VideoCollection() { ClipVideos = clipVideos.AsEnumerable() };
- foreach (var guid in requestInfo.VideoIDs)
- {
- Console.WriteLine("RequestInfo VideoId: {0}", guid);
- }
- var first = ve.ClipVideos.FirstOrDefault(x => x.ClipVideoKey == requestInfo.VideoIDs[0]);
- if (first == null)
- {
- Console.WriteLine("No id found");
- }
- else
- {
- Console.WriteLine("Clip Video Found: {0}", first.ClipVideoKey);
- }
- Console.Read();
- }
- }
- public class ClipVideo
- {
- public Guid ClipVideoKey { get; set; }
- }
- public class RequestInfo
- {
- public Guid[] VideoIDs { get; set; }
- }
- public class VideoCollection
- {
- public IEnumerable<ClipVideo> ClipVideos { get; set; }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement