|
|
Browse by Tags
All Tags » C# (RSS)
Showing page 1 of 11 (107 total posts)
-
If you look closely at your bin folder, you’ll see that besides getting your project’s assembly, you’ll also have another assembly with the your_Assembly_name.Contracts.dll name. This assembly is known as the contract reference assembly and it only has the public “interface” of the types defined on your assembly and their respective ...
-
In the last posts, I’ve been talking extensively about Code Contracts. If you’re a reader of this blog, you know that I’m hooked on it. I’ve just been reviewing the previous posts and I’ve noticed that I didn’t mention the Assert and Assume methods. Both are used for testing state and assumptions on a specific point of the program. As you ...
-
MSDN Developer Conference – Great new perks just announced Cool Giveaways The MSDN Developer Conference will not only WOW you with the coolest sessions from the PDC but you will also be in the running to win one of 3 Lego NXT Robotics Kits and the WROX Microsoft Robotics Developer Studio
book. Other giveaways include a Gamer Backpack ...
-
I finished up my talks at ASP.NET Connections yesterday and wanted to get the code posted as well as links for the additional topics covered in the Silverlight animation session. Here they are: Building N-Tier ASP.NET Applications with LINQ Code Silverlight 2 Animations Code SilverlightFX Farseer Physics Engine for ...
-
So,
you couldn’t make PDC this year? Watching recorded sessions not quite
doing it for you? Missing the interaction with Microsoft folks and
industry experts? Well, do we have a fantastic event for you! Come to
the Atlanta, GA MSDN Developer Conference
on December 16th at the Westin Peachtree Plaza. Right here in your ...
-
Today we’re going to keep looking at Code Contracts. Until now, I’ve been concentrating essentially in presenting its use and mentioning how great it is to have static analysis (ie, have something that goes through your code at compile time and detects several places which might breaking existing contracts). Today it’s time to take a look at the ...
-
After several failed tries, I finally managed to configure my home PC so that it runs the Server 2008 image (with the first preview of .NET 4.0) and just with a reasonable enough delay. Ok, since I'm finishing writing a book on C# 3.0 (with my good friend Paulo), I thought that I should start by looking at C# 4.0. As has been said, C# 4.0 will ...
-
Code Contracts also supports are quantifiers (with several limitations, as we’ll see). This means that you can check a predicate against elements in a collection or interval. You can use the ForAll method for running a predicate over several elements maintained on an collection or interval. The Exists method will let you apply a predicate and see ...
-
Before using Code Contracts, you’ll probably already written several lines of validation code for testing requirements on your methods. I’ll keep using the Person class to illustrate some code that you might have before using the Code Contracts library. So, in the past, you might have something like this:
public class Person { ...
-
One of the interest things Code Contracts lets you do is define additional contracts on your interfaces. To achieve this, you need to add a “dumb” class which implements that interface and add the required contracts to the body of the methods. To illustrate the necessary work, lets start by creating a new interface called IPerson:
public ...
1 ...
|
|
|