Reputation: 2635
I am converting a project from VB.Net, and I have a few lines that I am unable to convert propperly.
System.Runtime.Caching.MemoryCache.Default(Me.Name)
In this line, I understand that "Me.Name" has to be "this.Name", but the error is "Non-invocable member 'System.Runtime.Caching.MemoryCache.Default' cannot be used like a method.".
I have correctly added System.Runtime.Caching to References
Also return new string[];
. I have no idea how to convert this.
Thanks in advance,
René
Upvotes: 1
Views: 177
Reputation: 113402
It appears you want to call an indexer (sometimes called the Item
property). C# uses square-brackets []
for this purpose.
System.Runtime.Caching.MemoryCache.Default[this.Name]
I would suggest two other changes:
this.
using System.Runtime.Caching;
), the type doesn't have to be fully qualified. MemoryCache.Default[Name]
Upvotes: 3