Home > Article > Backend Development > What is the difference between IEnumerable and IQueryable in C#?
dbContext dc = new dbContext (); IEnumerable <SocialMedia> list = dc.SocialMedias.Where(p => p.Name.StartsWith("T")); list = list.Take<SocialMedia>(1); </SocialMedia>
SELECT [t0].[ID], [t0].[Name] FROM [SocialMedia] AS [t0] WHERE [t0].[Name] LIKE @p0
dbContext dc = new dbContext (); IQueryable<SocialMedia> list = dc.SocialMedias.Where(p => p.Name.StartsWith("T")); list = list.Take<SocialMedia>(1);
SELECT top 1 [t0].[ID], [t0].[Name] FROM [SocialMedia] AS [t0] WHERE [t0].[Name] LIKE @p0
The above is the detailed content of What is the difference between IEnumerable and IQueryable in C#?. For more information, please follow other related articles on the PHP Chinese website!