¡@

Home 

c# Programming Glossary: func

Distinct() with lambda?

http://stackoverflow.com/questions/1300088/distinct-with-lambda

expected is an overload that would take a lambda say a Func T T bool var distinctValues myCustomerList.Distinct c1 c2 c1.CustomerId..

C# Captured Variable In Loop

http://stackoverflow.com/questions/271440/c-sharp-captured-variable-in-loop

a interesting issue about C#. I have code like below List Func int actions new List Func int int variable 0 while variable.. C#. I have code like below List Func int actions new List Func int int variable 0 while variable 5 actions.Add variable 2 variable..

Dynamic LINQ OrderBy on IEnumerable<T>

http://stackoverflow.com/questions/41244/dynamic-linq-orderby-on-ienumerablet

expr pi type pi.PropertyType Type delegateType typeof Func .MakeGenericType typeof T type LambdaExpression lambda Expression.Lambda.. Hashtable callSites new Hashtable private static CallSite Func CallSite object object GetCallSiteLocked string name var callSite.. GetCallSiteLocked string name var callSite CallSite Func CallSite object object callSites name if callSite null callSites..

How to read a text file reversely with iterator in C#

http://stackoverflow.com/questions/452902/how-to-read-a-text-file-reversely-with-iterator-in-c-sharp

creating a Stream to read from. summary private readonly Func Stream streamSource summary Encoding to use when converting.. character. summary private readonly int bufferSize summary Function which when given a position within a file and a byte states.. byte represents the start of a character. summary private Func long byte bool characterStartDetector summary Creates a LineReader..

Linq Distinct on a particular Property

http://stackoverflow.com/questions/489258/linq-distinct-on-a-particular-property

DistinctBy TSource TKey this IEnumerable TSource source Func TSource TKey keySelector HashSet TKey seenKeys new HashSet TKey..

Retrieving Property name from lambda expression

http://stackoverflow.com/questions/671968/retrieving-property-name-from-lambda-expression

GetInfo T this HtmlHelper html Expression Func T object action where T class var expression GetMemberInfo action.. TSource TProperty TSource source Expression Func TSource TProperty propertyLambda Type type typeof TSource MemberExpression..

Benchmarking small code samples in C#, can this implementation be improved?

http://stackoverflow.com/questions/1047218/benchmarking-small-code-samples-in-c-can-this-implementation-be-improved

collector. I have the following simple benchmarking function which I have slowly evolved static void Profile string description.. void Profile string description int iterations Action func warm up func clean up GC.Collect var watch new Stopwatch watch.Start.. string description int iterations Action func warm up func clean up GC.Collect var watch new Stopwatch watch.Start for..

Func<T> with out parameter

http://stackoverflow.com/questions/1283127/funct-with-out-parameter

out in. Is there a way to do this c# .net linq generics func share improve this question ref and out are not part of..

Abuse of C# lambda expressions or Syntax brilliance?

http://stackoverflow.com/questions/1718037/abuse-of-c-sharp-lambda-expressions-or-syntax-brilliance

happens Hash params Func object TValue hash foreach var func in hash Add func.Method.GetParameters 0 .Name func null So.. Func object TValue hash foreach var func in hash Add func.Method.GetParameters 0 .Name func null So indeed the code is.. var func in hash Add func.Method.GetParameters 0 .Name func null So indeed the code is using the formal compile time name..

Compiler Ambiguous invocation error - anonymous method and method group with Func<> or Action

http://stackoverflow.com/questions/2057146/compiler-ambiguous-invocation-error-anonymous-method-and-method-group-with-fun

than anonymous methods or lambda syntax for calling a function. The function has two overloads one that takes an Action.. methods or lambda syntax for calling a function. The function has two overloads one that takes an Action the other takes.. ClassWithDelegateMethods public void Method Func string func do something public void Method Action action do something class..

How do I split a string by strings and include the delimiters using .NET?

http://stackoverflow.com/questions/2484919/how-do-i-split-a-string-by-strings-and-include-the-delimiters-using-net

public readonly List string Output public Result int funcID int srcID int delimID long milliseconds List string output.. int delimID long milliseconds List string output FuncID funcID SrcID srcID DelimID delimID Milliseconds milliseconds Output.. 3 srcID for int delimID 0 delimID 4 delimID for int funcId 3 funcId 0 funcId i tried various orders in my tests Stopwatch..

How to write Asynchronous LINQ query?

http://stackoverflow.com/questions/252355/how-to-write-asynchronous-linq-query

local. Thus you have no way of defining your callback function. This is a pretty major thing since a lot of linq to sql.. Exception errorCallback Func IEnumerable T IEnumerable T func new Func IEnumerable T IEnumerable T InnerEnumerate T IEnumerable.. InnerEnumerate T IEnumerable T result null IAsyncResult ar func.BeginInvoke query new AsyncCallback delegate IAsyncResult..

Is it Possible to Return a Reference to a Variable in C#? [duplicate]

http://stackoverflow.com/questions/4542536/is-it-possible-to-return-a-reference-to-a-variable-in-c

y z return ref doubleArray x y z To use it like this void func GetElement 5.0 It is like returning a double pointer in C .....

Why can't an anonymous method be assigned to var?

http://stackoverflow.com/questions/4965576/why-cant-an-anonymous-method-be-assigned-to-var

converting a .net Func<T> to a .net Expression<Func<T>>

http://stackoverflow.com/questions/767733/converting-a-net-funct-to-a-net-expressionfunct

do this that I am overlooking c# .net lambda expression func share improve this question Ooh it's not easy at all. Func..

Which cryptographic hash function should I choose?

http://stackoverflow.com/questions/800685/which-cryptographic-hash-function-should-i-choose

cryptographic hash function should I choose The .NET framework ships with 6 different.. 64 bytes 3820 ms RIPEMD 20 bytes 7066 ms Each of these functions performs differently MD5 being the fastest and RIPEMD being.. void TimeAction string description int iterations Action func var watch new Stopwatch watch.Start for int i 0 i iterations..

How to check for nulls in a deep lambda expression? [duplicate]

http://stackoverflow.com/questions/854591/how-to-check-for-nulls-in-a-deep-lambda-expression

model Expression Func TModel TResult expression var func expression.Compile var value func model return value public.. TResult expression var func expression.Compile var value func model return value public class One public Two Two get set.. Func TModel TResult expression TResult value try var func expression.Compile value func model catch NullReferenceException..