Giter VIP home page Giter VIP logo

Comments (4)

diegofrata avatar diegofrata commented on May 29, 2024 1

AFAIK there's no way to "stack" source-code generators. I think this might be a case of picking one or another but not both, and the reason for that is that if you want to use both you might end up in a situation where MVVMToolkit is using one equality strategy for a particular property while Generator.Equals is using a different equality strategy for the same property.

from generator.equals.

diegofrata avatar diegofrata commented on May 29, 2024

I am a bit confused as for what is the problem you're facing.

Source code generators are unaware of each other. So MVVM toolkit will generate some code and Generator.Equals will generate another, and you'll end up with two extra partial definitions of classes that may or may not agree with each other.

Generator.Equals implements equality at the object level so it wouldn't help you with implementing property changed notifications, if that's what you're aiming for.

from generator.equals.

diegofrata avatar diegofrata commented on May 29, 2024

Looks like your best shot is to apply attributes to the backing field and suppress warnings.

Out of curiosity what warnings are you getting by doing this?

from generator.equals.

jbooth88 avatar jbooth88 commented on May 29, 2024

MVVMTK0034

I still think the key is that tagging [property: DefaultEquality] to my backing field gets the attribute correctly applied to the property generated by the MVVM toolkit, but then the code generated by MVVM toolkit isn't analyzed, so even though the property definition includes DefaultEqualityAttribute, no equality code for that property is generated.

So yes, I think my options are to implement the property manually or ignore / suppress the compiler warning. Unless code generated by one roslyn source generator can be used by another source generator (somehow).

from generator.equals.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.