JsonLD.Entities icon indicating copy to clipboard operation
JsonLD.Entities copied to clipboard

Add [Type] annotation

Open tpluscode opened this issue 9 years ago • 0 comments

As suggested by @asbjornu, it will be good to give users an option to define @type using an attribute. Of course multiple would have to be allowed.

[Type("http://schema.org/Person")]
[Type("foaf:Person")]
public class Person
{
}

It would be equivalent to the current:

public class Person
{
    public string[] Type => new string[] 
    {
        "http://schema.org/Person",
        "foaf:Person"
    }
}

tpluscode avatar Jan 11 '17 13:01 tpluscode