c# - RavenDB Map only index returns null values after AsProjection<T> -


i have next index:

 public class testindex : abstractindexcreationtask<resource>     {         public class result         {             public string caption { get; set; }             public string testval{ get; set; }         }         public testindex()         {             map = resources => r in resources                                select new                                {                                    caption = r.caption,                                    testval = r.caption                                };          }     } 

and that's how query it:

            var data = session.query<resource, testindex>()                               .customize(x => x.waitfornonstaleresults())                               .asprojection<testindex.result>()                               .tolist(); 

the problem after query testval property null each object, when caption filled expected value.

if want projection index, need store value


Comments

Popular posts from this blog

design - Custom Styling Qt Quick Controls -

Unable to remove the www from url on https using .htaccess -