Top "Anonymous-methods" questions

An anonymous method is a procedure or function that does not have a name associated with it.

Anonymous method in Invoke call

Having a bit of trouble with the syntax where we want to call a delegate anonymously within a Control.Invoke. …

c# .net compiler-errors anonymous-methods
Is there a reason for C#'s reuse of the variable in a foreach?

When using lambda expressions or anonymous methods in C#, we have to be wary of the access to modified closure …

c# foreach lambda scope anonymous-methods
Unsubscribe anonymous method in C#

Is it possible to unsubscribe an anonymous method from an event? If I subscribe to an event like this: void …

c# delegates anonymous-methods
delegate keyword vs. lambda notation

Once it is compiled, is there a difference between: delegate { x = 0; } and () => { x = 0 } ?

c# .net delegates lambda anonymous-methods
C# - anonymous functions and event handlers

I have the following code: public List<IWFResourceInstance> FindStepsByType(IWFResource res) { List<IWFResourceInstance> retval = new List&…

c# scope anonymous-methods
Filtering records with IEnumerable.Select

In ASP.NET MVC 4 project, I have a model for join (with payload): public class LeagueMember { [Key, Column(Order = 0)] public …

c# asp.net-mvc linq entity-framework anonymous-methods
anonymous delegates in C#

I can't be the only one getting tired of defining and naming a delegate for just a single call to …

c# delegates anonymous-methods
DataTable.Select vs DataTable.rows.Find vs foreach vs Find(Predicate<T>)/Lambda

I have a DataTable/collection that is cached in memory, I want to use this as a source to generate …

.net optimization lambda anonymous-methods
Adding and Removing Anonymous Event Handler

I was wondering if this actually worked ? private void RegisterKeyChanged(T item) { item.OnKeyChanged += (o, k) => ChangeItemKey((T)o, …

c# events anonymous-methods
How to return a generic list collection in C#?

I have some linq to sql method and when it does the query it returns some anonymous type. I want …

c# .net generics anonymous-types anonymous-methods