I have a class defined as:
public class Student { public string Id { get; set; } public IDictionary<string, string> Attributes { get; set; } }
based on the discussion I found here: http://groups.google.com/group/ravendb/browse_thread/thread/88ea52620021ed6c?pli=1
I can store the instance quite easily:
//creation using (var session = store.OpenSession()) { //now the student: var student = new Student(); student.Attributes = new Dictionary<string, string>(); student.Attributes["NIC"] = "studentsNICnumberGoesHere"; session.Store(student); session.SaveChanges(); }
However, when I request it, as shown below:
//Testing query on attribute using (var session = store.OpenSession()) { var result = from student in session.Query<Student>() where student.Attributes["NIC"] == "studentsNICnumberGoesHere" select student; var test = result.ToList(); }
I get the error "System.Linq.Expressions.InstanceMethodCallExpressionN" to print "System.Linq.Expressions.MemberExpression". "as shown below:
How can I execute a query based on a key in a dictionary?
source share