What fluent interfaces have you made or seen in C# that were very valuable? What was so great about them?

后端 未结 11 1213
-上瘾入骨i
-上瘾入骨i 2021-01-31 05:42

\"Fluent interfaces\" is a fairly hot topic these days. C# 3.0 has some nice features (particularly extension methods) that help you make them.

FYI, a fluent API means

11条回答
  •  猫巷女王i
    2021-01-31 06:13

    As @John Sheehan mentioned, Ninject uses this type of API to specify bindings. Here are some example code from their user guide:

    Bind().To();
    Bind().ToSelf();
    Bind().ToSelf().Using();
    

提交回复
热议问题