Why is HttpContext.Current null?

Clearly HttpContext.Current is not null only if you access it in a thread that handles incoming requests. That’s why it works “when i use this code in another class of a page”. It won’t work in the scheduling related class because relevant code is not executed on a valid thread, but a background thread, which … Read more

does not implement interface member

Your class GetVenues does not implement the method mentioned in your error message. Where exactly are you stuck? GetVenuesByLocation(string search) is defined in the class Venue. I have noticed that this question is starting to garner interest. The issue here is very easy: your class does not implement (even if it’s abstract, you have to … Read more

C# Macro definitions in Preprocessor

No, C# does not support preprocessor macros like C. Visual Studio on the other hand has snippets. Visual Studio’s snippets are a feature of the IDE and are expanded in the editor rather than replaced in the code on compilation by a preprocessor.

Best way to “push” into C# array

array.push is like List<T>.Add. .NET arrays are fixed-size so you can’t actually add a new element. All you can do is create a new array that is one element larger than the original and then set that last element, e.g. EDIT: I’m not sure that this answer actually applies given this edit to the question: … Read more