문제

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?

도움이 되었습니까?

해결책 2

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

다른 팁

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top