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".
  • Changing Entity Framework model at runtime – Benny Michielsen
    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 thought on Changing Entity Framework model at runtime Jingming says 29 09 2011 at

    Original URL path: http://blog.bennymichielsen.be/2010/12/05/changing-entity-framework-model-at-runtime/ (2016-04-29)
    Open archived version from archive


  • Covering multi tenancy in the database – Benny Michielsen
    is stored in a different table Since now you have multiple tables representing the same model you ll have to figure out a way to migrate to new versions It s doable but keep it in mind you d also have to create some infrastructure to select the correct table when you issues your queries A variant on the customer specific table names is to create database schemas which are specific to your customer So you ll have CustomerA BlogPosts and CustomerB BlogPosts Apart from the fact that all data is stored in specific tables per customer like the approach stated above you can also add an additional security layer by using a specific database user per customer which can only access the tables of the specific schema All table names remain the same so you could even migrate specific customers to another database server as long as your infrastructure to look up the correct database schema name The most flexible way however but with quite an impact on your server is to create an entire database instance per customer this gives you the most available options You can use all available database tooling to revert specific databases if the customer asks you to etc I ve used all approaches stated in this post and even mixed and matched between them it all depends on the scale and requirements of your project For small projects I d use the first approach with the additional column For larger projects or where you need to support different data models per customer the schema specific approach or the entire database per customer are the way to go in my opinion Author BennyM Posted on 05 12 2010 Categories Software Development Leave a Reply Cancel reply Your email address will not be published Required

    Original URL path: http://blog.bennymichielsen.be/2010/12/05/covering-multi-tenancy-in-the-database/ (2016-04-29)
    Open archived version from archive

  • Config file behaviour MonoDevelop and Visual Studio – Benny Michielsen
    The only small difference in behaviour I ve noticed so far is that config files are not automatically copied to the output directory In order to do this right click the file go to Quick Properties and select Copy To Output Directory And another thing Add Reference in MonoDevelop is pure bliss Look at that speed Microsoft Author BennyM Posted on 25 02 2010 Categories Software Development Tags MonoDevelop Leave a Reply Cancel reply Your email address will not be published Required fields are marked Comment Name Email Website Post navigation Previous Previous post NoXML Spring NET Next Next post Covering multi tenancy in the database 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 and Raspberry Pi 3 bhldev on Exposing iCal data in WebAPI Archives March 2016 February 2016 August 2015 July 2015 June 2015 May 2015 April 2015 March 2014 November 2013 August 2012 July 2012 January 2012 November 2011 June 2011 May

    Original URL path: http://blog.bennymichielsen.be/2010/02/25/config-file-behaviour-monodevelop-and-visual-studio/ (2016-04-29)
    Open archived version from archive

  • NoXML Spring.NET – Benny Michielsen
    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 Reply Cancel reply Your email address will not be published Required fields are marked Comment Name Email Website Post navigation Previous Previous post Reading PDF files on the iPhone Next Next post Config file behaviour MonoDevelop and Visual Studio 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 and Raspberry Pi 3 bhldev on Exposing iCal data in WebAPI Archives March 2016 February 2016 August 2015 July 2015 June 2015 May 2015

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

  • Spring.NET – Benny Michielsen
    A SingleAction operating channel is still the easiest to configure object id MyService type WCFChannelManager ChannelManagerFactoryObject Perponcher WCFChannelManager property name ChannelType expression T Server IService1 Common property name EndpointConfigurationName value MyEndpoint object Creating a fixed pool is one extra line object id MyService type WCFChannelManager ChannelManagerFactoryObject Perponcher WCFChannelManager property name ChannelType expression T Server IService1 Common property name EndpointConfigurationName value MyEndpoint property name ChannelManagementMode value FixedPool object A variable pool means just another value as ChannelManagementMode object id MyService type WCFChannelManager ChannelManagerFactoryObject Perponcher WCFChannelManager property name ChannelType expression T Server IService1 Common property name EndpointConfigurationName value MyEndpoint property name ChannelManagementMode value VariablePool object If you want to use your own channel manager you can use the ProductTemplate to hook everything up The sample below illustrates this here the variable pool is configured via the template instead of using the ChannelManagementMode property of the FactoryObject object id MyService type WCFChannelManager ChannelManagerFactoryObject Perponcher WCFChannelManager property name ChannelType expression T Server IService1 Common property name EndpointConfigurationName value MyEndpoint property name ProductTemplate object property name ChannelManager object type WCFChannelManager ChannelPoolManager lt Server IService1 Perponcher WCFChannelManager constructor arg value MyEndpoint constructor arg object type WCFChannelManager AutoSizePoolFactory Perponcher WCFChannelManager constructor arg object property object property object The same approach can be used to configure the channelfactory for i e passing credentials object id MyService type WCFChannelManager ChannelManagerFactoryObject Perponcher WCFChannelManager property name ChannelType expression T Server IService1 Common property name EndpointConfigurationName value MyEndpoint property name ChannelManagementMode value VariablePool property name ProductTemplate object property name ChannelManager ChannelFactory Credentials UserName UserName value username property name ChannelManager ChannelFactory Credentials UserName Password value password object property object That s it for now Future additions will include setting the pool size of a fixed sized pool via the FactoryObject for now the default of 5 is used extend or add a new pool based on the SimplePool At the moment closed or faulted channels are not removed from that implementation meaning that when your 5 channels are closed the pool will raise an exception WCFChannelManager drop3 zip 1 16 mb Series Migrating from asmx webservices to WCF with Spring Net Configuring the ChannelManager First Drop Second Drop Third Drop Author BennyM Posted on 22 03 2009 Categories Software Development Spring NET Tags channel pool wcf Leave a comment on WCF ChannelManagement drop 3 WCF ChannelManagement drop 2 Updated version is now available no channel pooling yet but I changed the way default values and the ProductTemplate were being handled I ve already used the library successfully at work in a very heavy WCF application I found some issues with it like when you wanted to configure the ChannelFactory in your configuration file but these are now fixed Next up pooling WCFChannelManager drop2 zip 1 14 mb Series Migrating from asmx webservices to WCF with Spring Net Configuring the ChannelManager First Drop Second Drop Third Drop Author BennyM Posted on 14 03 2009 Categories Software Development Spring NET Tags channel wcf Leave a comment on WCF ChannelManagement drop 2 First drop of ChannelManagement available First drop available of the ChannelManagement library Currently only support single action channels meaning that after executing the operation the channel is closed I hope to add pooling the coming week The zip contains the source code and an example project Not much changes in the end user code static void Main string args var myService ContextRegistry GetContext GetObject MyService as IService1 string value myService GetData 5 var returnValue myService GetDataUsingDataContract new CompositeType BoolValue false StringValue Perponcher Console ReadLine spring context resource uri config spring objects context objects xmlns http www springframework net object id MyService type WCFChannelManager ChannelManagerFactoryObject Perponcher WCFChannelManager property name ChannelType expression T Server IService1 Common property name EndpointConfigurationName value MyEndpoint object objects spring system serviceModel client endpoint name MyEndpoint address http localhost 8731 Design Time Addresses Server Service1 contract Server IService1 binding wsHttpBinding client system serviceModel Out and ref parameters are not yet supported WCFChannelManager zip 1 17 mb Series Migrating from asmx webservices to WCF with Spring Net Configuring the ChannelManager First Drop Second Drop Third Drop Author BennyM Posted on 08 03 2009 Categories Software Development Spring NET Tags channel wcf Leave a comment on First drop of ChannelManagement available Configuring the ChannelManager I m trying to keep configuration to a minimum Let s look at an example object id MyService type WCFChannelManager ChannelManagerFactoryObject property name ChannelType expression T WCFChannelManagerTests IService property name EndpointConfigurationName value MyEndpointName object This is probably what you ll need the most You define the ChannelType that is the interface exposed by the service you want to consume and the EndpointConfigurationName which is the name of the endpoint in the system servicemodel section of your app web config And that s it The behaviour of the channel in this case is that a new channel will be created for every operation you want to execute object id MyService type WCFChannelManager ChannelManagerFactoryObject property name ChannelType expression T WCFChannelManagerTests IService property name EndpointConfigurationName value MyEndpointName property name ChannelManagementMode value Recycle object If you want channels to be reused you can specify this by changing the value of the ChannelManagementMode There are two predefined values you can use here Recycle and ThrowAway ThrowAway being the default Not sure about these names though object id OneTimeUseChannel type WCFChannelManager SingleActionChannelManager lt WCFChannelManagerTests IService object id MyService type WCFChannelManager ChannelManagerFactoryObject property name ChannelType expression T WCFChannelManagerTests IService property name EndpointConfigurationName value MyEndpointName property name ProductTemplate object property name ChannelManager ref OneTimeUseChannel object property object If one of the default ways to manage the lifecycle of a channel is not what you want or need you can create your own and specify it in the ProductTemplate property of the ChannelManagerFactoryObject The example above shows how you can do this in this case it would result in the same default behaviour you get in the first xml configuration I showed in the beginning of my post If you even want to customize the way a channel is retrieved an action is executed on it and then handed

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

  • fluent – Benny Michielsen
    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 Fluent Spring NET configuration with Recoil This is so important I had to blog about it immediately have not looked at it yet but I m excited Someone was kind enough to kick start a project to enable Spring NET configuration via a fluent interface Perhaps no more xml in the future Read all about it on the author s website and on the Spring NET forum Author BennyM Posted on 14 10 2009 Categories Software Development Spring NET Tags fluent Leave a comment on Fluent Spring NET configuration with Recoil 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

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

  • Reading PDF files on the iPhone – Benny Michielsen
    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 read less on the tiny iPhone screen and move to this new platform but this blog post has been in my todo list for far too long Author BennyM Posted on 14 02 2010 Categories Computer Tags iPhone PDF Leave a Reply Cancel reply Your email address will not be published Required fields are marked Comment Name Email Website Post navigation Previous Previous post Fluent Spring NET configuration with Recoil Next Next post NoXML Spring NET 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

    Original URL path: http://blog.bennymichielsen.be/2010/02/14/reading-pdf-files-on-the-iphone/ (2016-04-29)
    Open archived version from archive

  • PDF – Benny Michielsen
    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 read less on the tiny iPhone screen and move to this new platform but this blog post has been in my todo list for far too long Author BennyM Posted on 14 02 2010 Categories Computer Tags iPhone PDF Leave a comment on Reading PDF files on the iPhone 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

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