IEnumerable Queue.Count is not returning an integer [closed]












-4















I am attempting to define a queue named movingAverages with a size of queue.Count - period. I am getting an error "int IEnumerable.Count() ... - cannot be applied to method and int....



private static IEnumerable<DateClose> MovingAverage(
IEnumerable<DateClose> queue, int period)
{
Queue<DateClose> movingAverages = new Queue<DateClose>(queue.Count + period);
return movingAverages;

}









share|improve this question













closed as off-topic by Progman, Christian Gollhardt, Erik Philips, BJ Myers, Graham Nov 16 '18 at 0:40


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



  • "This question was caused by a problem that can no longer be reproduced or a simple typographical error. While similar questions may be on-topic here, this one was resolved in a manner unlikely to help future readers. This can often be avoided by identifying and closely inspecting the shortest program necessary to reproduce the problem before posting." – Erik Philips, BJ Myers, Graham

  • "Questions seeking debugging help ("why isn't this code working?") must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Questions without a clear problem statement are not useful to other readers. See: How to create a Minimal, Complete, and Verifiable example." – Progman, Christian Gollhardt


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














  • Please edit your question to include the full source code and the full error message.

    – Progman
    Nov 15 '18 at 22:17











  • .Count() is a method, not a property. You need the parenthesis. Otherwise you're attempting to add the method to an integer.

    – Glorin Oakenfoot
    Nov 15 '18 at 22:26


















-4















I am attempting to define a queue named movingAverages with a size of queue.Count - period. I am getting an error "int IEnumerable.Count() ... - cannot be applied to method and int....



private static IEnumerable<DateClose> MovingAverage(
IEnumerable<DateClose> queue, int period)
{
Queue<DateClose> movingAverages = new Queue<DateClose>(queue.Count + period);
return movingAverages;

}









share|improve this question













closed as off-topic by Progman, Christian Gollhardt, Erik Philips, BJ Myers, Graham Nov 16 '18 at 0:40


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



  • "This question was caused by a problem that can no longer be reproduced or a simple typographical error. While similar questions may be on-topic here, this one was resolved in a manner unlikely to help future readers. This can often be avoided by identifying and closely inspecting the shortest program necessary to reproduce the problem before posting." – Erik Philips, BJ Myers, Graham

  • "Questions seeking debugging help ("why isn't this code working?") must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Questions without a clear problem statement are not useful to other readers. See: How to create a Minimal, Complete, and Verifiable example." – Progman, Christian Gollhardt


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














  • Please edit your question to include the full source code and the full error message.

    – Progman
    Nov 15 '18 at 22:17











  • .Count() is a method, not a property. You need the parenthesis. Otherwise you're attempting to add the method to an integer.

    – Glorin Oakenfoot
    Nov 15 '18 at 22:26
















-4












-4








-4








I am attempting to define a queue named movingAverages with a size of queue.Count - period. I am getting an error "int IEnumerable.Count() ... - cannot be applied to method and int....



private static IEnumerable<DateClose> MovingAverage(
IEnumerable<DateClose> queue, int period)
{
Queue<DateClose> movingAverages = new Queue<DateClose>(queue.Count + period);
return movingAverages;

}









share|improve this question














I am attempting to define a queue named movingAverages with a size of queue.Count - period. I am getting an error "int IEnumerable.Count() ... - cannot be applied to method and int....



private static IEnumerable<DateClose> MovingAverage(
IEnumerable<DateClose> queue, int period)
{
Queue<DateClose> movingAverages = new Queue<DateClose>(queue.Count + period);
return movingAverages;

}






c#






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 15 '18 at 22:15









Jam66125Jam66125

596




596




closed as off-topic by Progman, Christian Gollhardt, Erik Philips, BJ Myers, Graham Nov 16 '18 at 0:40


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



  • "This question was caused by a problem that can no longer be reproduced or a simple typographical error. While similar questions may be on-topic here, this one was resolved in a manner unlikely to help future readers. This can often be avoided by identifying and closely inspecting the shortest program necessary to reproduce the problem before posting." – Erik Philips, BJ Myers, Graham

  • "Questions seeking debugging help ("why isn't this code working?") must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Questions without a clear problem statement are not useful to other readers. See: How to create a Minimal, Complete, and Verifiable example." – Progman, Christian Gollhardt


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




closed as off-topic by Progman, Christian Gollhardt, Erik Philips, BJ Myers, Graham Nov 16 '18 at 0:40


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



  • "This question was caused by a problem that can no longer be reproduced or a simple typographical error. While similar questions may be on-topic here, this one was resolved in a manner unlikely to help future readers. This can often be avoided by identifying and closely inspecting the shortest program necessary to reproduce the problem before posting." – Erik Philips, BJ Myers, Graham

  • "Questions seeking debugging help ("why isn't this code working?") must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Questions without a clear problem statement are not useful to other readers. See: How to create a Minimal, Complete, and Verifiable example." – Progman, Christian Gollhardt


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













  • Please edit your question to include the full source code and the full error message.

    – Progman
    Nov 15 '18 at 22:17











  • .Count() is a method, not a property. You need the parenthesis. Otherwise you're attempting to add the method to an integer.

    – Glorin Oakenfoot
    Nov 15 '18 at 22:26





















  • Please edit your question to include the full source code and the full error message.

    – Progman
    Nov 15 '18 at 22:17











  • .Count() is a method, not a property. You need the parenthesis. Otherwise you're attempting to add the method to an integer.

    – Glorin Oakenfoot
    Nov 15 '18 at 22:26



















Please edit your question to include the full source code and the full error message.

– Progman
Nov 15 '18 at 22:17





Please edit your question to include the full source code and the full error message.

– Progman
Nov 15 '18 at 22:17













.Count() is a method, not a property. You need the parenthesis. Otherwise you're attempting to add the method to an integer.

– Glorin Oakenfoot
Nov 15 '18 at 22:26







.Count() is a method, not a property. You need the parenthesis. Otherwise you're attempting to add the method to an integer.

– Glorin Oakenfoot
Nov 15 '18 at 22:26














1 Answer
1






active

oldest

votes


















3














Well it's because IEnumerable<T>.Count is a method, so you are missing the parentheses at queue.Count + period, which should be queue.Count() + period.






share|improve this answer






























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    3














    Well it's because IEnumerable<T>.Count is a method, so you are missing the parentheses at queue.Count + period, which should be queue.Count() + period.






    share|improve this answer




























      3














      Well it's because IEnumerable<T>.Count is a method, so you are missing the parentheses at queue.Count + period, which should be queue.Count() + period.






      share|improve this answer


























        3












        3








        3







        Well it's because IEnumerable<T>.Count is a method, so you are missing the parentheses at queue.Count + period, which should be queue.Count() + period.






        share|improve this answer













        Well it's because IEnumerable<T>.Count is a method, so you are missing the parentheses at queue.Count + period, which should be queue.Count() + period.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 15 '18 at 22:28









        MadKarelMadKarel

        812




        812















            Popular posts from this blog

            Guess what letter conforming each word

            Port of Spain

            Run scheduled task as local user group (not BUILTIN)