Click here to Skip to main content
14,602,214 members
   

C#

 
GeneralRe: Reference Types v. Value Types Pin
Richard Deeming1-Apr-20 2:20
mveRichard Deeming1-Apr-20 2:20 
GeneralRe: Reference Types v. Value Types Pin
F-ES Sitecore1-Apr-20 2:38
mveF-ES Sitecore1-Apr-20 2:38 
QuestionOverloaded Methods with Generics Pin
#realJSOP30-Mar-20 5:52
mva#realJSOP30-Mar-20 5:52 
AnswerRe: Overloaded Methods with Generics Pin
OriginalGriff30-Mar-20 6:34
mveOriginalGriff30-Mar-20 6:34 
GeneralRe: Overloaded Methods with Generics Pin
#realJSOP30-Mar-20 6:50
mva#realJSOP30-Mar-20 6:50 
GeneralRe: Overloaded Methods with Generics Pin
OriginalGriff30-Mar-20 8:28
mveOriginalGriff30-Mar-20 8:28 
GeneralRe: Overloaded Methods with Generics Pin
#realJSOP31-Mar-20 0:21
mva#realJSOP31-Mar-20 0:21 
AnswerRe: Overloaded Methods with Generics Pin
BillWoodruff30-Mar-20 16:33
mveBillWoodruff30-Mar-20 16:33 
this works using one overload in .NET 4.8; don't know about earlier releases:
private IEnumerable<T> DoSomething<T>(
    Func<T,T> func,
    params T[] args)
{
    foreach (T t in args)
    {
        yield return func(t);
    }
}

private IEnumerable<T> DoSomething<T>(
    Func<T,T> func,
    IEnumerable<T> args)
{
    return DoSomething(func, args.ToArray());
}

// sample calls
    //var t1 =  DoSomething(
        //t => t * 3, 
        //1,2,3,4,5);

    //var t2 =  DoSomething(
        //t => t * 3, Enumerable.Range(6, 10));
I don't claim it's elegant Smile | :)
«One day it will have to be officially admitted that what we have christened reality is an even greater illusion than the world of dreams.» Salvador Dali

GeneralRe: Overloaded Methods with Generics Pin
#realJSOP31-Mar-20 0:18
mva#realJSOP31-Mar-20 0:18 
GeneralRe: Overloaded Methods with Generics Pin
BillWoodruff31-Mar-20 5:17
mveBillWoodruff31-Mar-20 5:17 
AnswerRe: Overloaded Methods with Generics Pin
Richard Deeming31-Mar-20 1:26
mveRichard Deeming31-Mar-20 1:26 
GeneralRe: Overloaded Methods with Generics Pin
BillWoodruff31-Mar-20 5:32
mveBillWoodruff31-Mar-20 5:32 
GeneralRe: Overloaded Methods with Generics Pin
Richard Deeming31-Mar-20 8:51
mveRichard Deeming31-Mar-20 8:51 
GeneralRe: Overloaded Methods with Generics Pin
BillWoodruff31-Mar-20 11:49
mveBillWoodruff31-Mar-20 11:49 
GeneralRe: Overloaded Methods with Generics Pin
Richard Andrew x6431-Mar-20 13:57
professionalRichard Andrew x6431-Mar-20 13:57 
GeneralRe: Overloaded Methods with Generics Pin
Richard Deeming1-Apr-20 0:04
mveRichard Deeming1-Apr-20 0:04 
GeneralRe: Overloaded Methods with Generics Pin
BillWoodruff1-Apr-20 2:07
mveBillWoodruff1-Apr-20 2:07 
GeneralRe: Overloaded Methods with Generics Pin
Richard Deeming1-Apr-20 2:13
mveRichard Deeming1-Apr-20 2:13 
GeneralRe: Overloaded Methods with Generics Pin
Richard Deeming1-Apr-20 0:15
mveRichard Deeming1-Apr-20 0:15 
GeneralRe: Overloaded Methods with Generics Pin
#realJSOP31-Mar-20 23:26
mva#realJSOP31-Mar-20 23:26 
AnswerRe: Overloaded Methods with Generics Pin
James Curran7-Apr-20 4:48
MemberJames Curran7-Apr-20 4:48 
QuestionWpf Excel Pin
RajaMohammed.A26-Mar-20 3:55
MemberRajaMohammed.A26-Mar-20 3:55 
AnswerRe: Wpf Excel Pin
Richard MacCutchan26-Mar-20 4:12
mveRichard MacCutchan26-Mar-20 4:12 
AnswerRe: Wpf Excel Pin
jsc422-Apr-20 2:58
professionaljsc422-Apr-20 2:58 
QuestionC# Oracle SYSDBA connection string not able to working on windows 10? Pin
barathsamkumar25-Mar-20 4:39
Memberbarathsamkumar25-Mar-20 4:39 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.