where T : class

S

Shapper

Hello,

I have the following method:

public IQueryable<T> Find(Expression<Func<T, Boolean>> criteria);

But I get the error:

The type or namespace name 'T' could not be found (are you missing a using directive or an assembly reference?)

I changed it to:

public IQueryable<T> Find(Expression<Func<T, Boolean>> criteria) where T : class

But where is not recognized ... It works fine if I use:

void Find<T>(Expression<Func<T, Boolean>> criteria) where T : class;

In this case "where T : class" does not seem to even be necessary ...

Could someone help me in solving this?

Thank You,

Miguel
 
S

Shapper

Hello,

I have the following method:

public IQueryable<T> Find(Expression<Func<T, Boolean>> criteria);

But I get the error:

The type or namespace name 'T' could not be found (are you missing a using directive or an assembly reference?)

I changed it to:

public IQueryable<T> Find(Expression<Func<T, Boolean>> criteria) where T : class

But where is not recognized ... It works fine if I use:

void Find<T>(Expression<Func<T, Boolean>> criteria) where T : class;

In this case "where T : class" does not seem to even be necessary ...

Could someone help me in solving this?

Thank You,

Miguel

Oops, I missed the Find<T>. Solved.

Thanks,
Miguel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top