Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JsonIgnore] attribute #222

Open
ghost opened this issue Dec 15, 2014 · 3 comments
Open

[JsonIgnore] attribute #222

ghost opened this issue Dec 15, 2014 · 3 comments

Comments

@ghost
Copy link

ghost commented Dec 15, 2014

I think it'd be better if you guys figured out a way with how you're using newtonsoft json to override it's respect to the jsonignore attribute. Instead, you guys should have like a RiakSerializeIgnoreAttribute or something because I use JsonIgnore though only because I use newtonsoft json to serialize the same object for XHR.

@ghost
Copy link
Author

ghost commented Dec 15, 2014

there is a case now where I want to only block an attribute from getting saved in riak but not block it from XHR.

@ghost
Copy link
Author

ghost commented Dec 15, 2014

hmm ya.... ;/ kinda sux, if you want some example code on how to do attribute parsing:

    [AttributeUsage(AttributeTargets.Class)] // for this you would want a different target
    public class RESTService : System.Attribute
    {
        public RESTService ()
        {
        }
    }

this is kinda more or less how you can use LINQ to not only throw stuff around but throw people around as well ..

var test = Assembly.GetExecutingAssembly().GetTypes().Where(w => w.GetCustomAttributes().Any(a => a.GetType() == typeof(RESTService)));

//maybe even something more like this... I donno
var propsToIgnore = new object()
                .GetType()
                .GetProperties()
                .Where(w => w.GetCustomAttributes()
                    .Where(ww => ww.GetType() == typeof(RiakDontStoreThisThingAttribute)).Count() > 0);

@ghost
Copy link
Author

ghost commented Dec 15, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants