-1

We are using Entity Framework and Linq and are creating Repository methods.

If I have a generic class T, how would I obtain the actual class name, using Dynamic Linq preferably?

    public async Task GetTableName(T entity)
    {
        await T.
    }

Intellisense options picture

Erik Philips
  • 53,428
  • 11
  • 128
  • 150
  • Duplicate of [How do I get the type name of a generic type argument?](https://stackoverflow.com/questions/2581642/how-do-i-get-the-type-name-of-a-generic-type-argument) – Herohtar Oct 16 '19 at 18:06

1 Answers1

1

You mean like:

var test = typeof(T).Name;

You wouldn't need Linq for this.

Aage
  • 5,932
  • 2
  • 32
  • 57