开发者

Problem with RavenDB 'Hello World' tutorial

开发者 https://www.devze.com 2023-01-22 16:58 出处:网络
I am going through the RavenDB tutorial on the RavenDb.net website. It was going fine until I got to the code block for creati开发者_开发百科ng an index.

I am going through the RavenDB tutorial on the RavenDb.net website.

It was going fine until I got to the code block for creati开发者_开发百科ng an index.

This code segment is direct from RavenDB.Net website.

store.DatabaseCommands.PutIndex("OrdersContainingProduct", new IndexDefinition<Order>
{
    Map = orders => from order in orders
                    from line in order.OrderLines
                    select new { line.ProductId }
});

I get an error on compile: "The non-generic type 'Raven.Database.Indexing.IndexDefinition' cannot be used with type arguments."

If IndexDefinition is non-generic, why is it used as generic in the sample code? Where is the disconnect?

Thank you for your time Jim


Depending on your using statements you may be referencing the wrong IndexDefinition class (from another Raven assembly). Try adding this to the beginning of your file:

using Raven.Client.Indexes;

You might need to remove other using statements as well. I guess this is one reason why Microsoft recommends using unique names for classes even in the presence of namespaces.

0

精彩评论

暂无评论...
验证码 换一张
取 消