Building a Simple AngularJS Configuration Service

Monday, June 22, 2015

One of the things that I’m always being asked when I’m consulting about AngularJS is how to build a configuration service. The service requirements are to be able to load some configuration file and then to be able to use the configurations during runtime. This post will show you a simple AngularJS configuration service which can be a good starting point for your own implementation. Setting A Few Conventions Before we start writing the service, you should think about some conventions. For example, where is the location of the configuration file? What format to use? and so on. In my implementation the...
no comments

How to Configure a Self Referencing Entity in Code First

Friday, June 3, 2011

How to Configure a Self Referencing Entity in Code First A few days ago a worker in Sela asked me how to configure a self referencing entity with EF Code First. In this post I’ll show you how to implement that configuration. Self Reference Scenarios There are a lot of scenarios that we will want to implement a self reference between an entity to itself. For example, we do that when we want to create hierarchies in our application - an employee entity that has a self reference to his/her manager is a very common scenario for that. When we want to...

Using Code First Model Configurations Classes

Monday, March 7, 2011

Using Code First Model Configurations Classes In the past I explained how to use the Code First Fluent API in order to configure and shape your EDM during runtime. One of the problems that might raise when you use the Fluent API as I showed in the previous post is that the OnModelCreating method might become bloated and hard to read. This is the time to get familiar with another model configuration option which is built inside Code First. Model Configurations Classes When you use Code First you will probably configure the creation of the model...

Revisiting XML Configurations In Unity

Thursday, January 6, 2011

Revisiting XML Configurations In Unity In the past I wrote a few tutorials about Unity application block. One of the things I wrote about was how to configure a Unity container using design time configuration. In this post I’m going to revisit that post and show you how the configurations changed (for the better) and are much more easier to work with in the current version of Unity (version 2). The Unity Configuration Section As in my previous post we will first start with a small example of Unity configuration section in order to understand...

Update Configurations Without Replacing Them Using Enterprise Library 5 Fluent Configuration API

Thursday, October 28, 2010

Update Configurations Without Replacing Them Using Enterprise Library 5 Fluent Configuration API I got a question today in an article I published about the fluent configuration API in Enterprise Library 5. The question was how to add a database connection string to an existing configuration during runtime. The person who wrote the question also published a specific solution which I refactored to a general purpose solution that I’ll show in this post. The Problem When you use the fluent configuration API the ConfigurationSourceBuilder class has just one method to update the configuration which is UpdateConfigurationWithReplace. This method updates the configuration source and...
no comments

Back to Basic – ASP.NET Runtime Impersonation

Tuesday, September 7, 2010

Back to Basic – ASP.NET Runtime Impersonation Today I got a question from one of the developers at my main customer. The question was how to move an uploaded file from an ASP.NET server to a file server on the network. The answer is of course by impersonating. In this post I’ll explain how you can make ASP.NET impersonation and in more details how to make runtime impersonation. Impersonation in ASP.NET When we are doing I/O operations, the operation system makes security checks to understand if the user is authorized to do the operation. The same...
6 comments

Building a Simple Logging Http Module with Logging Application Block

Friday, May 21, 2010

Building a Simple Logging Http Module with Logging Application Block I wanted to check how to use the fluent configuration API  for the Logging Application Block in Enterprise Library 5. So I thought to myself why not implement it with an http module and provide two examples in one post. Using the Fluent Configuration API with Logging Application Block I wrote a post about the fluent configuration in Enterprise Library 5  in the past. Here is how I configured the Enterprise Library container in order to use the Logging Application Block in a simple flat file scenario: private void ConfigureEnterpriseLibraryContainer(){ var...

Enterprise Library 5 Fluent Configuration API

Thursday, April 22, 2010

Enterprise Library 5 Fluent Configuration API One of the new Enterprise Library 5 improvements is a new fluent configuration API. In this post I’ll explain the subject and then show how to use the fluent configuration API with the Data Access Application Block. Fluent Configuration API There are times that we would like to configure our application at runtime without using a configuration file such as web.config or app.config. In order to achieve that we can use the new fluent configuration API that was shipped with Enterprise Library 5. The API can be used to configure the core, instrumentation and all of...

Using External Configuration File for Enterprise Library Configuration

Sunday, November 15, 2009

Using External Configuration File for Enterprise Library Configuration One of the things that I always do when I’m using Enterprise Library is to separate its configurations to external configuration file. The reason is very obvious – using Enterprise Library makes configuration files very crowded. Since this is the case, the configuration files become unmanageable and then its time to separate the Enterprise Library’s configurations from other configurations. How to Use external Configuration File for Enterprise Library Configuration? It is very simple to separate the Enterprise Library configurations to another external file. Step 1 Create a new configuration file in the solution...
one comment

Back to Basics – How to Invoke Web Methods from a Remote Machine

Sunday, November 8, 2009

Back to Basics – How to Invoke Web Methods from a Remote Machine I’ve been asked today how to enable invocation of WebMethods of an asmx web service from a remote machine for testing. The post holds the answer. How to Invoke Web Methods from a Remote Machine? Sometimes we want to test our asmx web service not from localhost but from a remote machine. Trying to open the test form of the web service from a remote machine will show the following message: “The test form is only available for requests from the local machine”. In order to enable the...