I'm trying to get the following to work:
A class called Caption
, where I populate a List - adding Items
to the Class list
I then want to reference the list of class values, in a lookup method
public class Caption
{
readonly CaptionKey _CaptionKey; //Enum list
readonly string _Description;
public Caption(CaptionKey captionKey, string description)
{
_CaptionKey = captionKey;
_Description = description;
}
public CaptionKey CaptionKey { get { return _CaptionKey; } }
public string Description { get { return _Description; } }
}
Here is the class that creates the class list
public class InitCaptions
public static List<Caption> _Captions = new List<Caption>();
// the class access I need
public static string LookupCaption( CaptionKey )
{
//? How to return the description for
}
The problem is with referencing the list of classes from another class and process.
I can see the values in the debugger are there-
System.Collections.Generic.List<MyNamespace.Controllers.Captions>
I'm just not sure how to reference it properly.
I should add - this is a MVC solution - so the List is created in the application startup, but the reference call is done from a report - using ReportViewer. the List shows in the code using Intellisense, but when run - the List is not there.