I’ve just run into a nice feature of R#: it is capable of determining the interfaces a class has to implement based on context.

I was writing the code:


var selector = new SurrogateSelector();
selector.AddSurrogate(
typeof( AccountDto ),
new StreamingContext( StreamingContextStates.All ),
new AccountDtoSerializationSurrogate() );

R# detected the AccountDtoSerializationSurrogate was missing and it offered to scaffold it. When it did, it automatically marked it to implement ISerializationSurrogate.

I needed one more click to tell R# to implement the ISerializationSurrogate and I had all scaffolding done.

Nice job!

Advertisements