【发布时间】:2017-08-04 23:27:12
【问题描述】:
感谢 NetMage 在Linq search text using 'and' operator 中回答我的问题
现在,请让我问一些更复杂的:
我有以下表格,其中localizationdata.EntryId 链接到mascotcategories.Id 和mascots.Id,具体取决于localizationdata.Type 值。
`localizationdata` (
`Id` int(11)`, Type` varchar(45),
`EntryId` int(11),
`LanguageId` int(11),
`Value` varchar(150) }
`mascots` (
`Id` int(11), `Name` varchar(100),
`MascotCategoryId` int(11),
`UserId` varchar(100),
`mascotcategories` (
`Id` int(11), `CategoryName` varchar(45),
`IsVisible` bit(1),
`ParentId` int(11) DEFAULT NULL,
`SawgrassOnly` bit(1)
我需要再次对包含mascotcategories.CategoryName 和mascots.Name 的翻译词的localizationdata.value 进行“与”搜索(如我在上面链接中的上一个问题中)。
例如,用户将输入法语关键字“bleu ici”,其中“bleu”来自具有翻译类别名称的localizationdata.Value,“ici”也来自具有吉祥物翻译名称的localizationdata.Value。我需要在他们的名字和他们的类别名称中包含上述单词的吉祥物。这可行吗?
【问题讨论】:
-
“mascots.Id 取决于本地化数据.Type”是什么意思? “依赖”是什么意思?
-
本地化数据行可能是
Id= 1,Type = 'mascot'EntryId= 34,LanguageId= 1,Value= 'bleu' 另一行可能是:@987654336 @ = 2, Type = 'mascotcategory'EntryId= 52,LanguageId= 1,Value= 'ici' EntryId 是 mascots 或 mascotcategories 表的实际 id,localizationdata.Type 表示是 mascot 还是 mascotcategory .谢谢。