Skip to content

Instantly share code, notes, and snippets.

@DavidKarlas
Created May 23, 2016 07:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DavidKarlas/f199713320ee876c564f79df83d06dea to your computer and use it in GitHub Desktop.
Save DavidKarlas/f199713320ee876c564f79df83d06dea to your computer and use it in GitHub Desktop.
using System;
namespace cp654fz7
{
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Parameter, AllowMultiple = false)]
public sealed class JsonPropertyAttribute : Attribute
{
internal bool? _isReference;
internal int? _order;
public bool IsReference
{
get { return _isReference ?? default(bool); }
set { _isReference = value; }
}
public int Order
{
get { return _order ?? default(int); }
set { _order = value; }
}
public string PropertyName { get; set; }
public JsonPropertyAttribute()
{
}
public JsonPropertyAttribute(string propertyName)
{
PropertyName = propertyName;
}
}
class MainClass
{
[JsonProperty()]
public object MyProperty { get; set; }
public static void Main(string[] args)
{
}
}
}
@DavidKarlas
Copy link
Author

Showing only 1 constructor when I have 2
image
Showing all kind of classes instead of just IsReference= and Order=
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment