Asp.net Mvc display list depending on User
<p>What i have initially on my App is a list of expensives that is created based on the Scarfolding System but that list is the same for each User, and what i want is that each user can create his own list of expensives and see his own data.</p>

<p>So in the expensive class i did this:</p>

<pre><code>public class Despesa
{
    public int TipoDespesaId { get; set; }

    public int DespesaId { get; set; }

    public string UserId { get; set; }

    [Display(Name = "Descrição da Despesa")]
    [Required]
    public string DespesaDescricao { get; set; }

    [Display(Name = "Valor")]
    [Required]
    public decimal DespesaValor { get; set; }

    public int TipoPagamentoId { get; set; }

    [Display(Name = "Data")]
    [DataType(DataType.Date)]
    [CustomValidation(typeof(Validator), "ValidateEndTimeRange")]
    [DisplayFormat(DataFormatString = "{0:yyyy-MM-dd}",ApplyFormatInEditMode = true)]
    [Required]
    public DateTime Data { get; set; }

    public TipoDespesa TipoDespesa { get; set; }

    public TipoPagamento TipoPagamento { get; set; }

    [Display(Name = "Comentário")]
    public string Comentario { get; set; }

}
</code></pre>

<p>i just passed the UserId to the model and then in the Index controller of my Expensive View i did a linq query to compare the currentUserID to the Id of the expensive User here is my code:</p>

<pre><code>public ActionResult Index()
    {
        String userId = User.Identity.GetUserId();
        var despesas = from r in db.Despesas.Include(d =&gt; d.TipoDespesa).Include(d =&gt; d.TipoPagamento).Include(d =&gt; d.UserId)
                       where r.UserId.Equals(userId)
                       select r;

        return View(despesas.ToList());
    }
</code></pre>

<p>what i need to know is what i am doing wrong cause i get a <strong>invalidOperationException</strong></p>