Object-object mapping

I recently stumbled upon automapper. It’s a handy little library used for object-object mapping. Let’s take a look at that. The simplest usage If you find yourself having classes such as Foo, FooViewModel, FooListViewModel, FooDTO you probably have a decent amount of code which looks more or less like this: If you’re lazy like me, you probably wrapped that in some extension met…

By on (tags: automapper, categories: code)

Breaking strong name in .net library assemblies.

Recently I was digging in Strong naming and signing in .net. I have found an interesting article on code project Building Security Awareness in .NET Assemblies which describe how the strong name can be easily removed and beaked from an executing assembly. I would like to present the approach that can be used with library assemblies in .net. What is a strong name (also called st…

By Mirek on (tags: Assembly signing, .net, Strong name, categories: code, security)

WCF Data Services performance

The main benefit of using WCF Data Services (formerly codename ) is that this is interoperable, which means it can be accessed from clients created in different technologies. Moreover standard WCF services offers the only exposed set of methods. Data Services, as implementation of OData protocol, offers the Resource to be queried and altered using HTTP methods. That’s are the p…

By Mirek on (tags: Data Services, OData, WCF, categories: architecture, code)

Reading manifest from assembly

Information like product name, file version, copyright, etc are stored in the assembly manifest. In this post I would like to present how these informations can be read from an assembly and showed in the UI. Assembly manifest can be edited by choosing Properties on Visual Studio project and pressing button Assembly Information All we need to extract these data programmatically …

By Mirek on (tags: assembly information, manifest, categories: code)

EF Code First and SqlServer Ce 4.0 – the simplest example ever.

Recently I needed to write a simple database application. I chose the Entity Framework Code First (Code Only) as a Object Relational Mapper (ORM) because its simplicity and quick development process. If you did not yet heard about EF Code First then this is a good place to start. Entity framework is a very powerful technology. It totally makes the whole dirty work which in the …

By Mirek on (tags: Code First, Entity Framework, SqlServer Ce 4.0, categories: code)

Displaying hierarchical data in WPF and ASP.Net MVC

Let assume we have following self referencing table of people Each row represents the person and contains self unique identifier, name, last name and the Id of the parent or null if person has no parent. Now we would like to display the list of persons as a hierarchical tree showing the relationships between each person. Let create the Person model that will represent one perso…

By Mirek on (tags: ASP.NET MVC, hierarchical data, Self referencing tables, WPF, categories: code)

Forms authentication for all

Earlier I wrote about the problems of a common authentication approach. Today, I’m going to do a quick demonstration how to set up forms authentication to secure a web app with an oData service and how to use forms authentication to connect to the service from a wpf client. asp.net mvc Setting up forms authentication for this one is pretty easy – File –> New Project –> as…

By on (tags: authentication, categories: code)

Abstract repository for direct EF, WCF and WCF Data Services connection with database.

In this article I would like to show you my implementation and approach for using abstract repository no matter if the client is connecting directly to the database using Entity Framework, over WCF service or WCF Data Services (WCFDS) service. 1. General explicit repository The goal here is to have common interface of the repository so the client application does not care about…

By Mirek on (tags: Code First, Entity Framework, WCF Data Services, categories: architecture, code)