Entity Framework Code First & Search Criteria

前端 未结 2 1384
花落未央
花落未央 2020-12-13 03:22

So I have a model created in Entity Framework 4 using the CTP4 code first features. This is all working well together.

I am attempting to add an advanced search f

2条回答
  •  南笙
    南笙 (楼主)
    2020-12-13 03:35

    John,

    Your solution is absolutely awesome! But, just to share, I have been using this method above until I see your ideia.

    var items = context.Items.Where(t => t.Title.Contains(keyword) && !String.IsNullOrEmpty(keyword));
    

    So, it seems not to be the best solution for this, but for sure it is a way around.

提交回复
热议问题