Forum Xamarin.iOS

Announcement:

The Xamarin Forums have officially moved to the new Microsoft Q&A experience. Microsoft Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

To create new threads and ask questions head over to Microsoft Q&A for .NET and get involved today.

can't add list of items of type AVAsset to another list

Ryn9011Ryn9011 Member ✭✭
edited January 21 in Xamarin.iOS

I have a list of key value pairs and the value is a model with a property of type AvAsset.
Screen Shot 2021-01-21 at 11.25.47 PM

If I add the items in this list to another list, all of the model properties are copied except the AvAsset property. As shown below, the value is now null (the other properties are omitted from the screenshot. Also only the values were added to this list hence the key and value are not shown as in the above screenshot
Screen Shot 2021-01-21 at 11.26.27 PM

videos.Add(videoListItems.Select(a => a.Value).Where(b => b.VideoName == item.Value.VideoName).First());
The first screenshot is from inspecting 'videoListIems' and the second is from inspecting 'videos'

My question is why does this happen? and is there a way to add items from one list to another and retain the avasset property?

Answers

  • ColeXColeX Member, Xamarin Team Xamurai
    edited January 22

    The linq query may be invalid , can you debug on (videoListItems.Select(a => a.Value).Where(b => b.VideoName == item.Value.VideoName) to see what's the value ?


    Xamarin forums are migrating to a new home on Microsoft Q&A!
    We invite you to post new questions in the Xamarin forums’ new home on Microsoft Q&A!
    For more information, please refer to this sticky post.

  • Ryn9011Ryn9011 Member ✭✭

    I ended up not using the linq query, but the problem was still happening. In the end I found a way to accomplish my goals without copying the list of items that contained the avAsset types.

  • ColeXColeX Member, Xamarin Team Xamurai

    @Ryn9011 said:
    I ended up not using the linq query, but the problem was still happening. In the end I found a way to accomplish my goals without copying the list of items that contained the avAsset types.

    Could you share the solution here and mark it as answer ?

Sign In or Register to comment.