开发者

Can Lucene.NET be used with MVVM?

开发者 https://www.devze.com 2023-01-11 10:30 出处:网络
Just a quick pre-emptive question before we start to seriously investigate using Lucene. Currently building a C# WPF application, using MVVM and Microsoft Entity framework. My lead has brought up the

Just a quick pre-emptive question before we start to seriously investigate using Lucene.

Currently building a C# WPF application, using MVVM and Microsoft Entity framework. My lead has brought up the point that this might represent a problem with us not being able to let Lucene directly access the database, and therefore there might be difficulty in getting it to tie in with our BOL/DAL.

开发者_JAVA技巧

Anyone have any experience of tying Lucene in with such a model?


I have successfully used Lucene in a WPF application using MVVM, and I didn't encounter any problems.

Lucene should sit in your services layer. In the MVVM world, Lucene is your Model. The ViewModel just calls into Lucene with queuries and formats the results in whatever way is needed for the View to present it.

In my application, I had a service that was responsible for pulling relevant data out of the database and adding it to the Lucene index.

0

精彩评论

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