I have a model defined as
public class Department
{
[ScaffoldColumn(false)]
public object Id { get; set; }
[Required(ErrorMessage = "Department Name is required")]
[StringLength(25)]
[DisplayName("Department Name")]
public string Name { get; set; }
[DefaultValue(true)]
[DisplayName("Active?")]
public bool Active { get; set; }
}
i have added one record using the asp.net view. To retrieve the records i have created a simple index "DepartmentIndex
" as
from dept in docs.Departments
select new {dept.Id,dept.Name}
To fetch the records I am using the following linq query
var depts = dbSession.Query<Department>("DepartmentIndex").OrderByDescending(x => x.Id);
Till here everything is fine. I can see the first record I have added on my view page. But, when I start adding more records i don't see the newly added ones. What have I missed?