gpeipman

Stories submitted by gpeipman

Code Contracts: How they look after compiling?(weblogs.asp.net)

submitted by gpeipmangpeipman(3145) 2 years ago

When you are using new tools that make also something at code level then it is good idea to check out what additions are made to code during compilation. Code contracts have simple syntax when we are writing code at Visual Studio but what happens after compilation? Are our methods same as they look in code or are they different after compilation? In this posting I will show you how code contracts look after compiling. read more...

add a comment |category: |Views: 5

tags: another

ASP.NET MVC: Using jQuery context menu with tables(weblogs.asp.net)

submitted by gpeipmangpeipman(3145) 2 years ago

I needed to add context menus to some tables of my intranet application. After trying some components I found one that does everything I need and has no overhead. In this posting I will show you how to use jQuery context menu plug-in and how to attach it to tables. read more...

add a comment |category: |Views: 126

tags: another

Creating vCard action result(weblogs.asp.net)

submitted by gpeipmangpeipman(3145) 2 years ago

I added support for vCards to one of my ASP.NET MVC applications. I worked vCard support out as very simple and intelligent solution that fits perfectly to ASP.NET MVC applications. In this posting I will show you how to send vCards out as response to ASP.NET MVC request read more...

add a comment |category: |Views: 20

tags: another

Using Sandcastle to build code contracts documentation(weblogs.asp.net)

submitted by gpeipmangpeipman(3145) 2 years ago

In my last posting about code contracts I showed how code contracts are documented in XML-documents. In this posting I will show you how to get code contracts documented with Sandcastle and Sandcastle Help File Builder. read more...

add a comment |category: |Views: 27

tags: another

Enabling XML-documentation for code contracts(weblogs.asp.net)

submitted by gpeipmangpeipman(3145) 2 years ago

One nice feature that code contracts offer is updating of code documentation. If you are using source code documenting features of Visual Studio then code contracts may automate some tasks you otherwise have to implement manually. In this posting I will show you some XML documentation files with documented contracts. read more...

add a comment |category: |Views: 3

tags: another

Code Metrics: Number of IL Instructions(weblogs.asp.net)

submitted by gpeipmangpeipman(3145) 2 years ago

In my previous posting about code metrics I introduced how to measure LoC (Lines of Code) in .NET applications. Now let’s take a step further and let’s take a look how to measure compiled code. This way we can somehow have a picture about what compiler produces. In this posting I will introduce you code metric called number of IL instructions. read more...

add a comment |category: |Views: 4

tags: another

F# in ASP.NET, mathematics and testing(weblogs.asp.net)

submitted by gpeipmangpeipman(3145) 2 years ago

Starting from Visual Studio 2010 F# is full member of .NET Framework languages family. It is functional language with syntax specific to functional languages but I think it is time for us also notice and study functional languages. In this posting I will show you some examples about cool things other people have done using F#. read more...

add a comment |category: |Views: 7

tags: another

Code contracts and inheritance(weblogs.asp.net)

submitted by gpeipmangpeipman(3145) 2 years ago

In my last posting about code contracts I introduced you how to force code contracts to classes through interfaces. In this posting I will go step further and I will show you how code contracts work in the case of inherited classes. read more...

add a comment |category: |Views: 13

tags: another

Invariant code contracts – using class-wide contracts(weblogs.asp.net)

submitted by gpeipmangpeipman(3145) 2 years ago

It is possible to define invariant code contracts for classes. Invariant contracts should always hold true whatever member of class is called. In this posting I will show you how to use invariant code contracts so you understand how they work and how they should be tested. read more...

add a comment |category: |Views: 6

tags: another

Interface contracts – forcing code contracts through interfaces(weblogs.asp.net)

submitted by gpeipmangpeipman(3145) 2 years ago

Sometimes we need a way to make different implementations of same interface follow same rules. One option is to duplicate contracts to all implementation but this is not good option because we have duplicated code then. The other option is to force contracts to all implementations at interface level. In this posting I will show you how to do it using interface contracts and contracts class. read more...

add a comment |category: |Views: 9

tags: another

Code Contracts: Unit testing contracted code(weblogs.asp.net)

submitted by gpeipmangpeipman(3145) 2 years ago

Code contracts and unit tests are not replacements for each other. They both have different purpose and different nature. It does not matter if you are using code contracts or not – you still have to write tests for your code. In this posting I will show you how to unit test code with contracts. read more...

add a comment |category: |Views: 14

tags: another

Windows Phone 7 development: Using isolated storage(weblogs.asp.net)

submitted by gpeipmangpeipman(3145) 2 years ago

In my previous posting about Windows Phone 7 development I showed how to use WebBrowser control in Windows Phone 7. In this posting I make some other improvements to my blog reader application and I will show you how to use isolated storage to store information in phone. read more...

add a comment |category: |Views: 87

tags: another

Code Contracts: Hiding ContractException(weblogs.asp.net)

submitted by gpeipmangpeipman(3145) 2 years ago

It’s time to move on and improve my randomizer I wrote for an example of static checking of code contracts. In this posting I will modify contracts and give some explanations about pre-conditions and post-conditions. Also I will show you how to avoid ContractExceptions and how to replace them with your own exceptions. read more...

add a comment |category: |Views: 19

tags: another

Using runtime checking of code contracts in Visual Studio 2010(weblogs.asp.net)

submitted by gpeipmangpeipman(3145) 2 years ago

In my last posting about code contracts I introduced how to check input parameters of randomizer using static contracts checking. But you can also compile code contracts to your assemblies and use them also in runtime. In this posting I will show you simple example about runtime checking of code contracts. read more...

add a comment |category: |Views: 2

tags: another

How to configure Visual Studio 2010 code coverage for ASP.NET MVC unit(weblogs.asp.net)

submitted by gpeipmangpeipman(3145) 2 years ago

I just got Visual Studio 2010 code coverage work with ASP.NET MVC application unit tests. Everything is simple after you have spent some time with forums, blogs and Google. To save your valuable time I wrote this posting to guide you through the process of making code coverage work with ASP.NET MVC application unit tests. read more...

add a comment |category: |Views: 21

tags: another

Example: Controlling randomizer using code contracts(weblogs.asp.net)

submitted by gpeipmangpeipman(3145) 2 years ago

One cool addition to Visual Studio 2010 is support for code contracts. Code contracts make sure that all conditions under what method is supposed to run correctly are met. Those who are familiar with unit tests will find code contracts easy to use. In this posting I will show you simple example about static contract checking (example solution is included). read more...

add a comment |category: |Views: 5

tags: another