I have an object call video(See video class below ) in my C# application.
I have a list like List<object> mylist = new List<object>();
I have a while loop where objects are added to the list
While{
Video myvideo = new Video(id,path);
mylist.add(myvideo)
}
I would like to include in the while loop code that checks if an object exsist based on ONLY the ID since the path may be different.
If the ID exsist I would like to retrieve the path for that object.
Can you show me code examples of the following:
1. Check if object exsist with a particular ID.
2. Get the Path value for that object based on the ID.
3. Remove the object for that ID.
class Video
{
private string id;
private string Path;
public Video(string id, string Path)
{
this.MyPath = Path;
this.Myid = id;
}
public string Myid
{
get{return id;}
set{ id = value;}
}
public string MyPath
{
get { return Path; }
set { Path = value; }
}
}
}
Our community of experts have been thoroughly vetted for their expertise and industry experience.