0
我第一次使用從DATABSE代碼這裏是類:實體框架Lazyload問題
[Table("Language")]
public partial class Language
{
public Language()
{
LocaleString = new HashSet<LocaleString>();
}
public int Id { get; set; }
[Required]
[StringLength(100)]
public string Name { get; set; }
[Required]
[StringLength(20)]
public string Culture { get; set; }
public virtual ICollection<LocaleString> LocaleStrings { get; set; }
}
[Table("LocaleStringResource")]
public partial class LocaleString
{
public int Id { get; set; }
public int LanguageId { get; set; }
[Required]
[StringLength(200)]
public string Name { get; set; }
[Required]
public string Value { get; set; }
public virtual Language Language { get; set; }
}
,當我說localeString庫:repository.GetIQueryable()
結果是:
SELECT
[Extent1].[Id] AS [Id],
[Extent1].[LanguageId] AS [LanguageId],
[Extent1].[Name] AS [Name],
[Extent1].[Value] AS [Value]
FROM [dbo].[LocaleStrings] AS [Extent1]}
,爲什麼我說repository.GetIQueryable()。ToList()結果列表中包括的語言屬性和類型是一樣的東西dynamicProxies.Language,這意味着ToList還加載關係數據還是隻是因爲在調試器中看到結果?謝謝
不久 - 調試器。 –