How can I make my view return the sum of a collection?
<p>I am trying to do this with the following code but it gives me many errors:</p>

<pre><code>public abstract class BaseGridViewModel
{

    protected BaseGridViewModel()
    {
        Events = new List&lt;ViewEvent&gt;();
        Watch = Stopwatch.StartNew();
    }
    public SelectList Statuses { get; set; }
    public IList&lt;ViewEvent&gt; Events { get; set; }
    public string Topics { get; set; }
    public SelectList Types { get; set; }
    public string View { get; set; }
    public Stopwatch Watch { get; set; }

    public void Event(string description) {
        if (Watch.IsRunning) {
            Events.Add(new ViewEvent(description, Watch.ElapsedMilliseconds));
        } else {
            throw new Exception("Watch not running");
        }
    }
    public long Elapsed {
        get { 
            return Events.Sum(event =&gt; event.Elapsed)
        }
    }

public class ViewEvent {

    public long Elapsed { get; private set; }
    public string Description { get; private set; }
    public string Message { get; private set; }
    public int Quantity { get; private set; }

    public ViewEvent(string description, long elapsedTime, int quantity = 0, string message = "") {
        this.Description = description; 
        this.Elapsed = elapsedTime;
        this.Quantity = quantity;
        this.Message = message;
    }

}
</code></pre>

<p>All 9 errors are for this line: "return Events.Sum(event => event.Elapsed)"</p>

<p>Is there something wrong with my syntax for this?</p>
