none
The perennial 'Partial Properties' debate RRS feed

  • General discussion

  • Hi All

    I work primarily on Dynamics CRM and use generated "early bound" classes that I often need to modify and use partial classes extensively for this purpose but there is one use case that I have found no satisfactory way to achieve...

    A field/property is to no longer be used or has been replaced but needs to be retained in the table as there is data that will need to be migrated. To ensure that the 'backend' does not contain any references to that property in the generated class I need (would like to) mark the property as [Obsolete] so that the compiler will stop me using it. I can't safely set this in the generated class as it will get cleaned on the next build.

    I'm sure there are plenty of other similar use cases out there and I can see that the discussion has been around for nearly a decade and there's still no support in the compiler. There are arguments back and forth but I can't see why either a limited syntax or internally treating it like an interface definition where you can only have 1 that is not marked 'partial', neither of which would appear to me to 'break' the language or the compiler.

    Thoughts?

    Wednesday, October 10, 2018 4:50 PM