Is it ok to have an argument type of IEnumerable? [on hold]












0












$begingroup$


I've seen tutorials of Unit Testing and I've never seen IEnumerable<T> as an argument. Many authors use Repository pattern and services and there is no need to pass collections between the methods.



However, my signature of method looks like this:



private IEnumerable<Answer> GetPlayerAnswers(IEnumerable<Question> questions, 
IEnumerable<Answer> possibleAnswers)
{
...
}


Is it okay? Is it a code smell to have collections as arguments?










share|improve this question









$endgroup$



put on hold as off-topic by Malachi 8 hours ago


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Lacks concrete context: Code Review requires concrete code from a project, with sufficient context for reviewers to understand how that code is used. Pseudocode, stub code, hypothetical code, obfuscated code, and generic best practices are outside the scope of this site." – Malachi

If this question can be reworded to fit the rules in the help center, please edit the question.













  • $begingroup$
    This question does not have enough code to give an adequate code review, there isn't enough real code to give us context as to what your code is doing.
    $endgroup$
    – Malachi
    8 hours ago
















0












$begingroup$


I've seen tutorials of Unit Testing and I've never seen IEnumerable<T> as an argument. Many authors use Repository pattern and services and there is no need to pass collections between the methods.



However, my signature of method looks like this:



private IEnumerable<Answer> GetPlayerAnswers(IEnumerable<Question> questions, 
IEnumerable<Answer> possibleAnswers)
{
...
}


Is it okay? Is it a code smell to have collections as arguments?










share|improve this question









$endgroup$



put on hold as off-topic by Malachi 8 hours ago


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Lacks concrete context: Code Review requires concrete code from a project, with sufficient context for reviewers to understand how that code is used. Pseudocode, stub code, hypothetical code, obfuscated code, and generic best practices are outside the scope of this site." – Malachi

If this question can be reworded to fit the rules in the help center, please edit the question.













  • $begingroup$
    This question does not have enough code to give an adequate code review, there isn't enough real code to give us context as to what your code is doing.
    $endgroup$
    – Malachi
    8 hours ago














0












0








0





$begingroup$


I've seen tutorials of Unit Testing and I've never seen IEnumerable<T> as an argument. Many authors use Repository pattern and services and there is no need to pass collections between the methods.



However, my signature of method looks like this:



private IEnumerable<Answer> GetPlayerAnswers(IEnumerable<Question> questions, 
IEnumerable<Answer> possibleAnswers)
{
...
}


Is it okay? Is it a code smell to have collections as arguments?










share|improve this question









$endgroup$




I've seen tutorials of Unit Testing and I've never seen IEnumerable<T> as an argument. Many authors use Repository pattern and services and there is no need to pass collections between the methods.



However, my signature of method looks like this:



private IEnumerable<Answer> GetPlayerAnswers(IEnumerable<Question> questions, 
IEnumerable<Answer> possibleAnswers)
{
...
}


Is it okay? Is it a code smell to have collections as arguments?







c#






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked 8 hours ago









StepUpStepUp

251310




251310




put on hold as off-topic by Malachi 8 hours ago


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Lacks concrete context: Code Review requires concrete code from a project, with sufficient context for reviewers to understand how that code is used. Pseudocode, stub code, hypothetical code, obfuscated code, and generic best practices are outside the scope of this site." – Malachi

If this question can be reworded to fit the rules in the help center, please edit the question.




put on hold as off-topic by Malachi 8 hours ago


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Lacks concrete context: Code Review requires concrete code from a project, with sufficient context for reviewers to understand how that code is used. Pseudocode, stub code, hypothetical code, obfuscated code, and generic best practices are outside the scope of this site." – Malachi

If this question can be reworded to fit the rules in the help center, please edit the question.












  • $begingroup$
    This question does not have enough code to give an adequate code review, there isn't enough real code to give us context as to what your code is doing.
    $endgroup$
    – Malachi
    8 hours ago


















  • $begingroup$
    This question does not have enough code to give an adequate code review, there isn't enough real code to give us context as to what your code is doing.
    $endgroup$
    – Malachi
    8 hours ago
















$begingroup$
This question does not have enough code to give an adequate code review, there isn't enough real code to give us context as to what your code is doing.
$endgroup$
– Malachi
8 hours ago




$begingroup$
This question does not have enough code to give an adequate code review, there isn't enough real code to give us context as to what your code is doing.
$endgroup$
– Malachi
8 hours ago










0






active

oldest

votes

















0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes

Popular posts from this blog

How to make a Squid Proxy server?

Is this a new Fibonacci Identity?

19世紀