in
tri
home of the trivadians

Nach Ordnungsbegriffen durchsuchen

  • C# Acrobatics : Lambdas and Expression Methods as a replacement for NVelocity

    I’ve been very quiet recently. (I’m trying to not be so loud, Scott. ) You see, I’ve been writing a lot of ASP.Net code for a site I’m working on. And, to be honest, I’ve been having a lot of trouble. The source code for .Net has been very helpful, and I’ve learnt...
    Erstellt in Richard's blog (Weblog) von Anonymous am 06-02-2008
  • 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
  • ExtensionMethod.net - An Extension Methods Database

    While surfing around tonight, I came across ExtensionMethod.net, a database of useful Extension Methods for C# 3.0 and VB 9. I thought it might be useful, so I added a few of my own extension methods. IComparable<T>.LessThan int.Times int.To There aren’t many there yet, but there are one...
    Erstellt in Richard's blog (Weblog) von Anonymous am 03-03-2008
  • Remove and Sort Those Ugly “using-Statements”

    Visual Studio 2008 has lots of goodies in it, like LINQ syntax, CSS editing, and testing tools. There’s a lesser-known feature which I really appreciate though - the “Remove and Sort Usings” command in the C# editor. You activate the command by placing your cursor over the using statements...
    Erstellt in Richard's blog (Weblog) von Anonymous am 03-03-2008
  • Refactoring C# Series: Aggregation of IEnumerable

    I was recently reading this book about the Ruby programming language, and came across this piece of example code: [1,3,5,7].inject(0) {|sum, element| sum+element} -> 16 [1,3,5,7].inject(1) {|product, element| product*element} -> 105 Inject is a method which acts on an array...
    Erstellt in Richard's blog (Weblog) von Anonymous am 03-02-2008
  • The LinqDataSource and the Hidden Viewstate

    Yesterday I thought I’d learn about the LinqDataSource in ASP.Net 3.5, and got an interesting surprise. The new LinqDataSource can also be used with a LINQ-to-SQL model to perform updates. You simply add the DataSource to your page, set the table name, and set EnableUpdate to true. Then, using...
    Erstellt in Richard's blog (Weblog) von Anonymous am 02-21-2008
  • How to Update Data with LINQ-to-SQL

    When learning LINQ-to-SQL, it’s not immediately obvious how to do an update. Querying is easy, and there are methods for inserting and deleting. Updating usually occurs by modifying an object already known to the DataContext and then calling SubmitChanges on the context. var product = (from p in...
    Erstellt in Richard's blog (Weblog) von Anonymous am 02-18-2008
  • Writing Custom Exception Classes the Quick Way

    Until recently I thought this was a well-known feature. After demonstrating it a few times, I found out it wasn’t. A long time ago, in an cubicle far, far away, someone created the .Net Framework. To cut a long story short, they simultaneously produced guidelines for creating Exception classes...
    Erstellt in Richard's blog (Weblog) von Anonymous am 02-15-2008
  • How to See the SQL Generated by a LINQ to SQL Command

    Quick tip: If you want to see the SQL generated by LINQ to SQL for a query or command, simply set the Log property of your generated DataContext class to an instance of a TextReader. If this is your code: using System; using System.Linq; using System.Data.Linq; namespace LINQtoSQLConsole { class...
    Erstellt in Richard's blog (Weblog) von Anonymous am 02-14-2008
  • How to Use Grouping in C# LINQ Syntax

    When you started using LINQ, did you think it looked like SQL? I did. The more I learned LINQ, the more I realized it wasn’t anything like SQL. Take grouping, for example. Because LINQ has a group by statement, and it looks like SQL, I assumed that the syntax for grouping in LINQ would be just...
    Erstellt in Richard's blog (Weblog) von Anonymous am 02-08-2008
Seite 1 von 3 (24 Treffer) 1 2 3 > Weiter
/