Click here to Skip to main content
15,889,096 members
Home / Discussions / C#
   

C#

 
AnswerRe: Memory Management in Unit Testing Pin
Pete O'Hanlon1-Apr-20 0:24
mvePete O'Hanlon1-Apr-20 0:24 
AnswerRe: Memory Management in Unit Testing Pin
F-ES Sitecore1-Apr-20 1:38
professionalF-ES Sitecore1-Apr-20 1:38 
QuestionReference Types v. Value Types Pin
Richard Andrew x6431-Mar-20 10:52
professionalRichard Andrew x6431-Mar-20 10:52 
AnswerRe: Reference Types v. Value Types Pin
OriginalGriff31-Mar-20 11:42
mveOriginalGriff31-Mar-20 11:42 
AnswerRe: Reference Types v. Value Types Pin
BillWoodruff31-Mar-20 12:31
professionalBillWoodruff31-Mar-20 12:31 
GeneralRe: Reference Types v. Value Types Pin
Richard Andrew x6431-Mar-20 13:38
professionalRichard Andrew x6431-Mar-20 13:38 
GeneralRe: Reference Types v. Value Types Pin
BillWoodruff31-Mar-20 18:38
professionalBillWoodruff31-Mar-20 18:38 
AnswerRe: Reference Types v. Value Types Pin
F-ES Sitecore1-Apr-20 1:19
professionalF-ES Sitecore1-Apr-20 1:19 
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
professionalF-ES Sitecore1-Apr-20 2:38 
QuestionOverloaded Methods with Generics Pin
#realJSOP30-Mar-20 5:52
mve#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
mve#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
mve#realJSOP31-Mar-20 0:21 
AnswerRe: Overloaded Methods with Generics Pin
BillWoodruff30-Mar-20 16:33
professionalBillWoodruff30-Mar-20 16:33 
GeneralRe: Overloaded Methods with Generics Pin
#realJSOP31-Mar-20 0:18
mve#realJSOP31-Mar-20 0:18 
GeneralRe: Overloaded Methods with Generics Pin
BillWoodruff31-Mar-20 5:17
professionalBillWoodruff31-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
professionalBillWoodruff31-Mar-20 5:32 
Hi Richard, using these tests with the code I posted here, I believe 'AsEnumerable may not be necessary:
// note: being lazy here by omitting the generic <int> metadata in the method calls 
//... something I would not allow my students to do !

            var t0 =  DoSomething(
                t => t * 3, 
                100).ToList();

           var t1 =  DoSomething(
                t => t * 3, 
                1,2,3,4,5).ToList();

            var t2 =  DoSomething(
                t => t * 3, Enumerable.Range(6, 10)).ToList();

            var t3 =  DoSomething(
                t => t * 3, new[] { 11, 12, 13 }).ToList();

            var t4 =  DoSomething(
                t => t * 3, new List<int> { 14, 15, 16 }).ToList();
Of course, I am assuming J's choice of using the same method name (overloading) is rational, and that it implies one instance of T is handled the same way as multiple instances.
«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
Richard Deeming31-Mar-20 8:51
mveRichard Deeming31-Mar-20 8:51 
GeneralRe: Overloaded Methods with Generics Pin
BillWoodruff31-Mar-20 11:49
professionalBillWoodruff31-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
professionalBillWoodruff1-Apr-20 2:07 

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.