Archives
-
EF Code First : Simple sample
You heard about Entity Framework and want to try it. Let’s start with a very simple example. We will create a Console Application, add a class Person and generate the database from this class. Open Visual Studio and create a Console Application. I called mine EFFirstSample. Now, you have to allow Code First on your [...]
-
[EF Code First] What happen to my Person table ?
I’m writing an article about EF Code Fisrt and i get a strange behaviour. I create a simple class Person : public class Person { public int PersonId { get; set; } public string LastName { get; set; } public string FirstName { get; set; } public DateTime BirthDate { get; set; } } I [...]
-
DropDownList from enum in Asp.Net MVC
I found an excellent article that explain how to play with enum in a form. Stuart Leeks explains how to create an extension method to render enumeration as dropdownlist. I’m not going to re-explain all. Just share the article with you : ASP.NET MVC – Creating a DropDownList helper for enums Edit (20/09/2011) : If [...]
Sep 19th, 2011 | Filed under ASP.Net MVC -
Asp.Net MVC, Login and ReturnUrl
If you use AuthorizeAttribute in your controller, you surely encountered this kind of “issue”. Imagine, you try to create a blog application and on your Home, you let a “Add new article” link. As you want to protect your blog, you add an Authorize attribute on your Create method in the controller like this : [...]
Sep 19th, 2011 | Filed under ASP.Net MVC -
[EF] The specified type member ‘Property’ is not supported in LINQ to Entities
I’m playing with ASP.Net MVC and Entity Framework and I just encountered this error : “The specified type member ‘Property’ is not supported in LINQ to Entities. Only initializers, entity members, and entity navigation properties are supported.“. I’m trying to display a list of posts in my view (yes, it is MVC) and my post [...]
-
Schema comparison and deployment scripts
Here is our third part of this serie. Database -> Project We will first study the case when we modify the database schema. Retake our previous project used during the second article and, using Sql Server Management Studio, we will update our database. First, add a new column in MaTableB :
Tags: Database, Database project -
How to use Commands in WPF
Today, we will talk about WPF Commands. When I develop a new application in WPF, I try to follow the MVVM Pattern (Model-View-ViewModel). To help me, I use the toolkit shared by Laurent Bugnion : Mvvm Light Toolkit (Galasoft). If you don’t use it, no matter, the idea is the same with or without a [...]
-
WPF et les Commandes (ICommand)
Aujourd’hui nous allons aborder les Command dans WPF. Afin de me faciliter la vie, j’applique, dans la mesure de ma compréhension, le pattern MVVM (Model-View-ViewModel). Pour cela, j’utilise un framework proposé par Laurent Bugnion : Mvvm Light Toolkit (Galasoft) mais du moment que vous appliquez le pattern MVVM avec ou sans framework, le fonctionnement sera [...]
-
Creating a database project from an existing database
Here is my second article about the database project. This time, we’ll talk about the case when the project is already started and where database scripts are managed manually. Imagine, you arrive on a project and somebody explain you how to use the script file. you have to be careful on where you paste your [...]
Tags: Database project -
Creating a database project with Visual Studio
First, Why should you use this kind of project ? Simple ! This kind of project generate automatically scripts to deploy your database. You just have to create a file for each element you want to create (table, stored procedures, triggers …) and Visual Studio would generate a script file that will execute every query [...]
Tags: Database project