archive-be.com » BE » B » BENNYMICHIELSEN.BE

Total: 348

Choose link from "Titles, links and description words view":

Or switch to "Titles and links view".
  • May 2011 – Benny Michielsen
    project using NuGet you probably don t want to include those in your version control system When you want to share some code in a blogpost you don t want to include all the dlls that are referenced by your project since people can install the packages through NuGet When you install a package though a file gets added called packages config containing all information needed by NuGet to find it in the repositories There s no out of the box solution though all the hooks are in place You need to install the package called NuGet CommandLine This allows you to issue the nuget command which lets you refer to the packages config file Then use your package console manager to issue the following command nuget i PathToConfig o Packages You ll see all your packages fly by You can find more info over here Author BennyM Posted on 20 05 2011 21 05 2011 Categories Software Development 1 Comment on NuGet install all packages referenced by a project Entity Framework 4 1 Inheritance Table per Concrete Type There s one more way to implement the sample domain model in the database and that s a table for each class with all properties And unfortunatly our luck ends a bit here Although it s possible to generate an ERD that looks like what we want to achieve I need to change the domain model You get the database model above by using the following mapping code protected override void OnModelCreating DbModelBuilder modelBuilder modelBuilder Entity Movie Map x x MapInheritedProperties ToTable Movies modelBuilder Entity Cd Map x x MapInheritedProperties ToTable Cds modelBuilder Entity Book Map x x MapInheritedProperties ToTable Books base OnModelCreating modelBuilder Pollymorphic associations though are not supported using this inheritance strategy and so you need to omit the collection of products in the category class bummer public class Category Required public virtual Guid Id get set Required public virtual string Name get set public virtual IList Product Products get set Author BennyM Posted on 20 05 2011 Categories Software Development Leave a comment on Entity Framework 4 1 Inheritance Table per Concrete Type Entity Framework 4 1 Inheritance Table per Type Using the same model as before we want to store it more in a normalized fashion and in my opinion something that closely resembles a typical inheritance structure in code Lets create one table for each entity with only the properties it contains all other ones are linked through a one to one mapping To achieve this result you ll need to create your mappings as illustrated below protected override void OnModelCreating DbModelBuilder modelBuilder modelBuilder Entity Movie ToTable Movies modelBuilder Entity Cd ToTable Cds modelBuilder Entity Book ToTable Books base OnModelCreating modelBuilder Author BennyM Posted on 20 05 2011 21 05 2011 Categories Software Development Leave a comment on Entity Framework 4 1 Inheritance Table per Type Entity Framework 4 1 Inheritance Table per Hierarchy By default if you apply inheritance in Entity Framework 4 1 the

    Original URL path: http://blog.bennymichielsen.be/2011/05/ (2016-04-29)
    Open archived version from archive


  • January 2011 – Benny Michielsen
    review Silverlight 4 in Action In order to prepare for a Silverlight course I was going to give I looked around for some new books and material to help my students and to refresh my knowledge If you want to get started from zero on Silverlight I can highly recommend Silverlight 4 in Action It s an updated version from Silverlight 2 in Action and available since August 2010 via Manning The book is divided in three parts with the first two giving you all the necessary information to get you started and a third part which digs deeper into some more special topics In part one you re introduced to Silverlight how it relates to WPF and why you could choose it to build your next application You get an overview of XAML and browser and desktop integration options While it s just the first part of the book don t think it s just for newbies You get an in depth explanation on how the rendering system works what the different types of controls are and how text can be used Part two gives you all the information you need to build real applications You re introduced to the binding features what your options are for data validation and how you can communicate with other applications Either Silverlight plugins on the same page or other systems via web services The last two chapters also give a nice explanation of the MVVM pattern although it goes way further and shows you ways to improve the maintainability of your code Very nice to see SOLID and DRY come into play hopefully we ll see more developers using those principles The last chapter covers WCF RIA services these were new to me and I was a bit blown away by the functionality that s available out of the box though I m still a bit sceptic It might be a bit too much forms over data even though there are some layers in between where you can plug into to do your thing The last part adds chapters on working with graphics creating animations improving the install experience using styles and resources and creating custom controls Some of those you ll use often printing for instance others maybe once in a lifetime like creating a custom panel Overall a very nice read to introduce you to the platform and create real world applications It s definitely developer oriented though don t expect to see much Expression Blend which you ll use to create themes and animations which I don t think you ll be doing in code as illustrated in the book Author BennyM Posted on 16 01 2011 Categories Software Development Tags book silverlight Leave a comment on Book review Silverlight 4 in Action CRM 4 0 Support A colleague of mine was fighting with CRM 4 0 at a client side He was able to fix all their issues except one They had changed from HTTP to HTTPS after

    Original URL path: http://blog.bennymichielsen.be/2011/01/ (2016-04-29)
    Open archived version from archive

  • December 2010 – Benny Michielsen
    a partial class with the name of your context class and inherit from AdaptingContext instead of ObjectContext public partial class AdventureWorksEntities AdaptingObjectContext public AdventureWorksEntities base name AdventureWorksEntities AdventureWorksEntities new ConnectionAdapter new TablePrefixModelAdapter MyPrefix Assembly GetExecutingAssembly OnContextCreated This partial class has the same name as the partial class generated by the Entity Framework You should remove the generated constructors and base class specification from that one or your code will not compile Note that every time you update the model with the designer it will regenerate the constructors etc so you have to remove them every time In this example I m using the TablePrefixModelAdapter which will prefix all my tables with my specified prefix in this case MyPrefix Consuming this context is done just like a normal ObjectContext You also need to specify where the mappings that need to be altered are located in this sample I m using a single console application so they are contained in the executing assembly using var context new AdventureWorksEntities var products context Products products ToList ForEach x Console Write x Name And this generates the following SQL SELECT 1 AS C1 Extent1 ProductID AS ProductID Extent1 Name AS Name Extent1 ProductNumber AS ProductNumber FROM Production MyPrefixProduct AS Extent1 So we re all set to support multi tenancy Not quite The code as available in the CodePlex project stores the updated mappings in a static variable for performance reasons this is great if you re developing against a development database and your code will run against a production database with different naming or schema For a multi tenant application we need a different model for each of our customers so we need to make another change to the code as available in the CodePlex project If you don t mind taking the performance hit to rewrite the mapping every single time an object context is created you can just open the ConnectionAdapter class and change the static variables which hold the model information to instance variables And optimized version would store all the mappings per customer so you only rewrite the mappings once a new customer hits the context and from that point store them in i e a dictionary with key the customerID and value the updated mappings I ve used Entity Framework 3 5 SP1 and Visual Studio 2008 in this post Author BennyM Posted on 05 12 2010 Categories Software Development Tags entity framework 1 Comment on Changing Entity Framework model at runtime Covering multi tenancy in the database You there computer man Make it a multi tenant application There are several ways to support multi tenancy on the database part of your application The easiest approach would be to add a CustomerID column to each table This is easy to maintain since any change you make in your development environment add a column change a type needs to be done only once on the live environment The downside however is that all data of all your customers is mixed in

    Original URL path: http://blog.bennymichielsen.be/2010/12/ (2016-04-29)
    Open archived version from archive

  • February 2010 – Benny Michielsen
    drop them too The reason I m still sticking to this framework is because it offers so much DI AoP data access messaging most applications I ve created need at least some components from the Spring NET stack Erich Eichinger has posted on CodeConfig and assembly scanning for Spring NET a while ago and it is scheduled to be included in Spring NET in the future Go check it out Author BennyM Posted on 14 02 2010 Categories Software Development Spring NET Tags fluent Leave a comment on NoXML Spring NET Reading PDF files on the iPhone You can natively read PDF files with your iPhone yet one feature that is lacking is a go to page feature This is not an issue when you have a file which is only 2 3 pages long typical size of a file being send through mail But when you want to get some serious reading done and have already read a couple of hundred pages in the book having to skip through all of them when you want to continue where you left off becomes a serious issue fast There are a lot of options when you look for pdf or ebook reader in the App Store some are payware some are free I was very reluctant to get one in the past hoping that Apple in its infinite wisdom would add the feature to the standard PDF reader Yet as of this date it s still not implemented A friend suggested I check out Aji Reader it s free at the moment and I ve used it for several months I m quite happy with it You can get content on your phone with a desktop application that syncs your pdf files With the iPad around the corner I ll probably

    Original URL path: http://blog.bennymichielsen.be/2010/02/ (2016-04-29)
    Open archived version from archive

  • October 2009 – Benny Michielsen
    this will become the standard in the future for my current project this was the best and easiest option More info can be found here Running NET Apps in 32 bit mode on 64 bit Windows MSDN 64 bit Applications Visual Studio Development Environment 64 Bit Support forum post at the SQLite site Author BennyM Posted on 12 10 2009 Categories Software Development Tags sqlite 6 Comments on Using SQLite in 64 bit NET environments October 2009 bookshelf Sams Teach Yourself WPF in 24 Hours I m in the process of creating an application for a friend of mine who is starting his own company He needs a little CMS system to support his business in the advertising world He gave me a nice layout to use in the application so WPF seemed to be the best option I jumped right in only to find that it was more complex than I first expected After looking around what was available I decided to go for this book since it s co authored by Rob Eisenberg who is in charge of the Caliburn framework I m just passed the first part of the book which introduces the layout containers grid stackpanel wrappanel and the basic containers It already helped me getting the layout right for the application I m writing Also the code snippets in the book are in colour which certainly improves the readability of especially the XAML The Art of Unit Testing with Examples in NET Though I m convinced of TDD and unit testing in general I find it hard to apply when doing projects at work I m hoping this book will help me to structure my programming work around TDD and how to write good maintainable tests The text is written in an easy to read

    Original URL path: http://blog.bennymichielsen.be/2009/10/ (2016-04-29)
    Open archived version from archive

  • July 2009 – Benny Michielsen
    you got one presenter let s see an OrderPresenter with one view OrdersView you quickly see the mistake that was made But in more complex situations let s say that OrdersPresenter was also talking to an CustomerPresenter and OrderDetailPresenter which in turn talked to other presenters you ll be switching between Visual Studio and ANTS to try to understand what s going on in the system Never the less I was able to get all the forms disposed properly when they were closed or no longer needed Except in one specific situation The application has a multiple document interface MDI When it starts it loads the OrdersOverview form and shows some global information in this example all current orders When I closed this overview screen and looked at the output from Ants the form was still in memory No matter what I tried for some reason the MDI parent kept referring to the MDI child which was closed After hours of walking through the code to find the culprit I launched one Google query which found a page on Microsoft Connect It s a bug in the NET framework sigh what a waste of time Another thing that was new to me was that whenever you show a form as modal and you close it It will be kept active as well you need to explicitly call Dispose to get rid of it Four years of WinForm development and I still learn so much new stuff Author BennyM Posted on 23 07 2009 Categories Software Development Tags garbage gc memory winforms Leave a comment on Memory profiling from the trenches SVN Repository available I ve made availble a svn repository with the source code of the channel library for Spring Net and my work on a Cuyahoga module for events

    Original URL path: http://blog.bennymichielsen.be/2009/07/ (2016-04-29)
    Open archived version from archive

  • June 2009 – Benny Michielsen
    Categories Software Development Tags architecture nhibernate tdd Leave a comment on This week on my screen 10 Search Search for Search Follow me Recent Comments Rick on Partitioning and wildcards in an Azure Data Factory pipeline BennyM on WCF HTTPS And Request Entity Too Large Justin on WCF HTTPS And Request Entity Too Large The Morning Brew Chris Alcock The Morning Brew 2052 on Getting up and running with Mono

    Original URL path: http://blog.bennymichielsen.be/2009/06/ (2016-04-29)
    Open archived version from archive

  • May 2009 – Benny Michielsen
    I ve also started a little project for my own which will be based on Ruby on Rails I have no experience with it what so ever I followed the steps on the offical site please note that you need super user privileges so begin each command with sudo While everything was installing I stumbled upon this article on the Apple site which I m now following to understand and learn the language and the framework It s a year old but seems up to date so far They also specify the sudo command so you re ok with my first tip Author BennyM Posted on 14 05 2009 Categories Software Development Tags rails ruby Leave a comment on Taking babysteps into Ruby on Rails land This week on my screen 8 Jimmy Nilsson on Chunck cloud computing InfoQ presentation 10 ways to code better NHibernate IPreUpdate IPreInsert explained Something from way back Black Sunday hack via Coding Horror Author BennyM Posted on 02 05 2009 Categories Software Development Tags cloud hack nhibernate Leave a comment on This week on my screen 8 Search Search for Search Follow me Recent Comments Rick on Partitioning and wildcards in an Azure Data

    Original URL path: http://blog.bennymichielsen.be/2009/05/ (2016-04-29)
    Open archived version from archive