-5

if I have a class like this :

public class ApplicationDbContext : IdentityDbContext<ApplicationUser>, IDbContext

how can I get some properties of ApplicationUserinside ApplicationDbContext ?

kosnkov
  • 5,609
  • 13
  • 66
  • 107

1 Answers1

0

Think of the following program:

class Program
{
    static void Main(string[] args)
    {
        var calc = new Calculator<string>();
        Console.WriteLine(calc.Add(1,1));
    }
}

class Calculator<T>
{
    public int Add(int a, int b)
    {
        return a + b;
    }
}

There is no way to get any string-like properties from the calculator.

The reason is that string is a type parameter, not an object. Whether or not the class makes properties accessible depends on many other factors. A List<T> allows to get objects of type T back, but other classes needn't do that.

Thomas Weller
  • 55,411
  • 20
  • 125
  • 222