ASP.NET MVC プロジェクトで EntityFramework を使用しています。
以下のエンティティがあるとします。
public class Project
{
public int ProjectID { get; set; }
public string Description { get; set; }
public string Tags { get; set; }
}
DB に次のデータがあるとします。
ProjectID: 1
Description: "My first element"
Tags: "one, three, five, seven"
ProjectID: 2
Description: "My second element"
Tags: "one, two, three, six"
ProjectID: 3
Description: "My third element"
Tags: "two, three, four"
特定の数のタグを含むすべてのプロジェクトを返したいと考えています。たとえば、「one」と「three」のタグが付いたすべてのプロジェクトを取得したいとします。検索するタグのリストは動的で、次のような変数に格納されますsearchFor = "one, three";
。
どのようにできるのか?
ありがとう。