Dav Dav - 1 year ago 82
C# Question

How can I consider default data for IQueryable<className>

I have many IQueryable on my code, and sometimes I need to return data as nothing.
I don't want to return null as data, because I can't handle on client side

Also I test something like this, but didn't get result

IQueryable<className> obj=new IQueryable<className>();

Answer Source

I am used to use Enumerable.Empty<T>() when I need to return empty enumerables. In the same way you may return an empty IEnumerable as IQueryable;

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download