Hi. My question is basically this:
If I set dynamic data from one class, can I access that same data from another class? Below is the rough pseudocode of what I am trying to do:
Public Class Person
{
public string ID { get; set; }
public string Name { get; set; }
}
And, I do the below:
Public Class SomeClass
{
private void SomeMethod()
{
List<Person> p = new List<Person>();
loop {
p.Add(id[i], name[i]);
Timer t = new Timer();
t.Interval = 1000;
}
}
Can I access the values set in SomeClass from SomeOtherClass such that:
Public SomeOtherClass
{
private List<Person> SomeOtherMethod(string id)
{
// HERE, THE RESPONSE VALUES MAY CHANGE BASED ON
// WHERE IN THE LOOP SomeClass.SomeMethod HAS SET
// THE VALUES IN Person.
var query = from p in Person
where p.ID == id
select p;
return query.ToList();
}
}
Thanks for your thoughts...