We are working with a database containing metadata on all database tables and fields used in our applications. From this metadata, we generate code that contains partial classes, extending our Linq2Sql entities.
We had the idea of adding an "obsolete" flag in our metadata, which should in turn add the Obsolete-attribute to the flagged properies in the Linq object. (generating warnings in our code using old fields)
Is this type of extension possible in a partial class? To just add an attribute to a property in a partial class file? This sounds a lot like a "partial property", something I tought didn't exist in .NET.
Yeah, check out the MetadataType attribute.
Good example here. In this context, they want to add attributes for the purposes of validation, but no reason you couldn't do the same to indicate obsolescence.