How to allow mine to CookieDatabe shared in the following code? I get an ad compile-time error ICookieService2.
public struct CookieData<T>
{
T Value { get; set; }
DateTime Expires { get; set; }
}
public interface ICookieService2: IDictionary<string, CookieData<T>>
{
}
My mistake:
Cannot find type name or namespace 'T' (are you missing the using directive or assembly references?)
I want to ICookieService2contain general data in it. Thanks!
Change . Would it block me into one Tto build any ICookieService2?
Edit 2 I am trying to do the following:
CookieData<int> intCookie = { Value = 27, Expires = DateTime.Now };
CookieData<string> stringCookie = { Value = "Bob", Expires = DateTime.Now };
CookieService2 cs = new CookieService2();
cs.Add(intCookie);
cs.Add(stringCookie);
source
share