I have the following code:
public static class ScraperMasterUriDetails
{
public static Dictionary<Guid, string> MasterUriDetails;
}
However I've decided that I need to add an integer to the dictionary Dictionary<ScraperMasterUriDetails>
, so I thought I'd add properties and a few parameters to the constructor.
But, you can't do that in C#. How do I implement what I'm trying to implement?
EDIT:
A more experienced member edited my post, so I'll leave it how it is. I don't care about using a dictionary (was just the right thing to use at the time)
Essentially I just want a list of three types of data in a structure manner, except I always want to refer to once instance of the class which stores the values, hence static. Now I've always done List of(T) like:
public class WebsiteTitles
{
public string WebsiteId { get; set; }
public string Keywords { get; set; }
public WebsiteTitles(string websiteguid, string keywords)
{
WebsiteId = websiteguid;
Keywords = keywords;
}
public WebsiteTitles()
{
}
}
And then done the following
List<WebsiteTitles> _siteTitles = new List<WebsiteTitles>();
_siteTitles.Add(new WebsiteTitles("blah", "keyword"));
However in this scenario I want like something similar to the above, but static (don't want to be creating instances etc. I really appreciate all the suggestions, hence why I edited my post to provide more information.
As a note, I'll probably want to use LINQ to extract some records e.g. get record where guid == guid etc. That's about all I'll use it for.