Suggestions for implementing a simple search for “business objects” in a .NET WinForms app?

前端 未结 4 427
失恋的感觉
失恋的感觉 2021-01-16 03:01

What\'s the best way to go about providing a simple search capability for \"business objects\" in a .NET WinForms application?

By \"simple search\" I mean something

4条回答
  •  逝去的感伤
    2021-01-16 03:47

    I think your approach of use a "Contains" method in each object is quite usefull.

    You can give "weight" to the members of the object so that if the contains method finds a match, give a sort of "Score" as a return.

    Other thing to take into account is whether the match is a full match or not... and assign more or less point to that score.

    If you search accross multiple types of objects... may be you can assign higher values to the main objects (more business centric objects) in order to give them more priority.

    Just thoughts...

提交回复
热议问题