When I run this code:
return dbAccess.ExecuteDataTable(dbAccess)
.AsEnumerable()
.Select(r => r.Field<int>("Id"))
.ToList();
It gives me an error:
SqlParameter is already in the SqlParameterCollection
Although I know that AsEnumerable works on this concept deferred execution or lazy loading, but this concept still hasnt made a place in my head.
Can anyone please explain the working of AsEnumerable and this code?