Comments (4)
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.
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.
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.
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)
- Indexers on classes lead to syntactically invalid generated code HOT 1
- Compiler-error with static properties HOT 1
- Suppress obsolete warnings in generated code HOT 2
- Explicit mode HOT 3
- Remove the runtime dependency HOT 3
- Replace MSTest and NUnit with Xunit.
- Support for struct HOT 4
- Support for Record Struct HOT 2
- What if properties of a class are also generated by another code generator? HOT 6
- Inherited classes Equals ignored when called from the base class HOT 6
- Inherited classes Equals ignored when using OrderedEquality on an array of the base class HOT 16
- Cleanup IEquatable<T> implementation for classes HOT 1
- NullReferenceExceptions starting with v2.7.2 HOT 4
- Feature Request: Would be great to be able to enumerate the properties that are different! HOT 5
- Feature Request: Create comparer for strings HOT 2
- `IEnumerable<T>` property marked by `[UnorderedEquality]` causes exception during generation HOT 7
- Probably, the generator is not incremental HOT 2
- Add license information in csproj/Nuget HOT 2
- Support StringEqualityAttribute on collections of strings HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from generator.equals.