Another C# trick: Fluents, Inheritance and Extension Methods (blogs.msdn.com)
submitted by
crpietschmann(11.3k) 2 years, 3 months ago
Here’s a scenario which Damien and I encountered recently.
We needed a way of specifying Facets for properties on Entities, i.e. things like Nullable, MaxLength, Precision etc.
And we needed a class hierarchy because different types of properties have different sets of available facets.
The base class of the hierarchy is called PropertyConfiguration which defines a series of Fluent methods that are shared by all sub types:
|category: C#
|Views: 26
tags:
ExtensionMethods C#3 Fluent C# Generics another
Everyones tags:
Your Tags: