GetType on Linq-result
-
Saturday, April 27, 2013 7:26 PM
I have tried each of the following (not at the same time):
var testVar = dataContext.Movies;
IQueryable<Movie> testVar = dataContext.Movies;
IEnumerable<Movie> testVar = dataContext.Movies;
...
testVar.GetType().ToString();
The result for anyone of the tree is
System.Data.Linq.Table`1[Movies.Models.Movie]
Does anyone know why im not getting IQueryable or IEnumerable?
All Replies
-
Tuesday, April 30, 2013 7:49 AMModerator
Hi sfddsfsdfsfsd,
GetType method is defined in Object class which returns the type of current instance.
An object can implement an interface, but it can never be an instance of interface. GetType method will return the concrete type rather than the interface type.
Best regards,
Chester Hong
MSDN Community Support | Feedback to us
Develop and promote your apps in Windows Store
Please remember to mark the replies as answers if they help and unmark them if they provide no help.- Marked As Answer by Chester HongMicrosoft Contingent Staff, Moderator Tuesday, May 07, 2013 8:48 AM