Question

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?

Was it helpful?

Solution 2

I was using build #133 i upgraded to #140 now, this doesn't seems to be a problem.

OTHER TIPS

RavenDB updates indexes in the background, so the results might be stale. See the documentation here for more info. In the client API you need to call the function WaitForNonStaleResults, to do this.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top