mardi 18 avril 2017

C#: return the definition of a class (Java getClazz duplicate)

I am trying to reurn a class definition to use it later for the deserialization of a json object, more or less a duplicate of the following Java function:

public Class<?> getClazz()
{
    return Account.class;
}

So far I have written this in my c# solution (Models being a folder that contains Account.cs, the file describing the Account class):

public Type getClass()
    {
        return Models.Account;
    }

The error I'm getting reads: 'Account is a Type, which is not valid in the given context.'

I'm using Microsoft Visual Studio 2015, any help or advice is much appreciated!






Comments
0 Comments

0 commentaires:

Enregistrer un commentaire