c# - Why can I not "see" this enum extension method? -


Why can not I see this enum extension method? (I think I'm going crazy)

File1.cs

  Names1 also {public enum website: integer {Website1 = 0, WEBSITE2}}.  

File 2 CS

  Using NS1; Namespace NS2 {public class} methipp: request handler & lt; Request, feedback & gt; {Public Override Response Handle (Request Request, CRequest cRequest) {// does not compile, can not "see" websites on ToDictionary on Website = Website.ToDictionary & LT; Integer & gt; (); Return tap; }} // Dictionary of the public static class EnumExtensions {public static IDictionary ToDictionary & lt enum converts; TEnumValueType & gt;! (The Enum E) {if (typeof (TEnumValueType) .FullName = Enum.GetUnderlyingType (e.GetType ()) FullName; New logic expression ("Specify invalid type."); Enum.GetValues ​​(e.GetType ()) .Cast & lt Return; Object & gt; () .toDictionary (key => Enum.GetName (e.GetType (), key), value = & gt; (TEnumValueType) value); }}}  

"itemprop =" text ">

After you try to call the extension method as a static method Type the object instead of an example method instead of expanding methods. This experiment is not supported

If you are an example then the extension method is found.

  website website = Website.Website1; Var Websites = Website. Two option & lt; Int & gt; ();  

Comments