Skip to content

{ Category Archives } C#

join in LINQ to SQL and LINQ to Entities Considered Messy, Redundant

In this post I will demonstrate that use of the join keyword in LINQ to SQL and LINQ to Entities is nearly always wrong. LINQ queries which you write with the join keyword are harder to read and write than queries you write using associations, and they require knowledge of database metadata which is not [...]

Tagged , ,

Projecting Onto a Presentation Model with the Entity Framework and ASP.NET MVC

In this post, I will demonstrate how to map entity models to views in an ASP.NET MVC application without worrying about implementation details like eager loading, lazy loading, or having to manually optimize SQL for the task at hand. I will argue that expressing the relationship between an entity model in the presentation model in [...]

Tagged , ,

Updating to ASP.NET MVC 2 Preview 2

Last week, I updated our main development branch to ASP.NET MVC 2 preview 2 (from preview 1). In this post, I’ll list some of the features I’ve found, and also issues I encountered and how I resolved them.
New Features
Some of the new features of preview 2 have been discussed elsewhere, so I won’t rehash them. [...]

Tagged , , , ,

Comparing C#, C++, and Delphi (Win32) Generics

C#, C++, and Delphi all have a generic type and method language feature. Although all three languages are statically typed, they implement generics in very different ways. I’m going to give a brief overview of the differences, both in terms of language features and implementation. I presume that Delphi Prism generics work essentially the same [...]

Tagged , , , , ,

NDepend Review and Tips

On and off for the past few months, I’ve been experimenting with the .NET static analysis tool NDepend. NDepend works somewhat differently than most other static analysis tools I’ve tried. Notably,

Most tools tend to work on either compiled assemblies or source code. NDepend uses both.
Most tools implement their tests in compiled, executable code. NDepend, on [...]

Tagged , , , ,

Static Analysis and Generated Code

In recent months, I’ve been thinking about the problem of static analysis in generated code. Static analysis means using tools like FxCop and NDepend (for .NET apps) lint (for C) and CodeHealer (for Delphi) to find potential problems in your source code. Generated code is code written not by a human being, but by [...]

Tagged , , , , , , ,

How to Think Like the ADO.NET Entity Framework at CodeRage 4

This coming Wednesday 9 September I’ll be doing a presentation at the free, online CodeRage 4 conference:
How to Think Like the ADO.NET Entity Framework
(and why you might want to bother learning to do so in the first place)
In order to use the ADO.NET Entity Framework effectively, you must understand its value-based data model, which is [...]

Tagged ,

Using DayPilot with ASP.NET MVC

I’m going to demonstrate how to use the open-source DayPilot Lite calendar control in an ASP.NET MVC application. I will discuss the capabilities of the control and consider the general problem of how to use controls designed for "plain" ASP.NET in MVC applications. I’m including a demo solution which you can download and run yourself.
Download [...]

Tagged , , , ,

Using jqGrid with ASP.NET MVC: Understanding LINQ Errors

If you spend enough time with the PagedList class that I’ve been using for paging in the method which supplies data to jqGrid, it’s a near-certainty that sooner or later you will see a LINQ error with Count in the call stack. The error may seem confusing, because it has nothing to do with Count. [...]

Tagged , , , , , ,

Using jqGrid with ASP.NET MVC: Deleting Records

This is the fifth post in a series on using jqGrid with ASP.NET MVC. Today, we’re going to begin examining the grid’s editing features by implementing deletes. If you’re new to the series, you might want to start at the beginning.
The delete feature of jqGrid is, oddly, almost entirely undocumented, even though there quite a [...]

Tagged , ,

Bad Behavior has blocked 713 access attempts in the last 7 days.

Close