in
tri
home of the trivadians

Nach Ordnungsbegriffen durchsuchen

  • Design Guidelines for LINQ

    Have you wondered if and when you should use the new LINQ features in .Net 3.5? Like, where should I put a new extension method? Should I use Func<T> or a custom delegate? How do I best implement a mix-in (extension methods on an interface)? Well, Mircea Trofin has just published a new draft...
    Erstellt in Richard's blog (Weblog) von Anonymous am 03-13-2008
  • Can You Pass an Anonymous Type Across Functions?

    One of the biggest questions with Anonymous Types is “can I pass them around?” If not, why not? Can you do something like this, for example: var GetAnonymousValue() { return new { Name = “Richard Bushnell” }; } void Main() { var value = GetAnonymousValue(); var name = value.Name;...
    Erstellt in Richard's blog (Weblog) von Anonymous am 01-08-2008
  • Fun with C# Extension Methods: Quick Loops

    In my last post, I demonstrated an extension method for easy creation of ranges, using the 1.To(x) syntax, similar to the Ruby [1..x] syntax. Today I’m writing another copy of a Ruby idea which lets you do a quick loop using a terse and easy-to-read syntax. Remember, if you want to create your...
    Erstellt in Richard's blog (Weblog) von Anonymous am 01-02-2008
  • Fun with C# Extension Methods: Easy Ranges

    I’m not a real Ruby on Rails developer, but I’ve tried to learn it, just to broaden my perspective. Coming from a C# background, I’m impressed by how easy it is to read Ruby code. In fact, it is usually so compact and self-descriptive, you can understand it just by reading the code...
    Erstellt in Richard's blog (Weblog) von Anonymous am 12-30-2007
  • A Mixin for IComparable<T>

    Following on from my other posts on C# Mixins, here’s a short one to demonstrate the benefits of Mixins using IComparable<T>. I don’t know about you, but I can never remember how the CompareTo method of IComparable<T> works. If I remember correctly, it gives back -1 if the...
    Erstellt in Richard's blog (Weblog) von Anonymous am 12-27-2007
  • A not-so-simple Mixin with C# 3.0

    My last post gave a simple idea of how to do a Mixin with C#. Rather than repeating what someone else has already done, if you want to see a more complex example of what can be done, check out Create Mixins with Interfaces and Extension Methods by Bill Wagner at MSDN.com.
    Erstellt in Richard's blog (Weblog) von Anonymous am 12-26-2007
Seite 1 von 1 (6 Treffer)
/