Home

Castle Stronghold

Table of contents

OnCreate Facility

The OnCreate Facility makes it possible to allow further modifications after initialization

Facility Summary
Uses ProxyNo
Requires configurationYes
Uses attributeNo
Version2.0
Maturity levelMedium

Introduction

This facility allows you to modify a service after it is created.

Quick start

This facility requires programatic configuration


    public class MyComp
    {
        string Name{get;set;}    
        ...
    }
    

If you want to set the Name property after it is created you can do something like


        kernel.Register(Component.For<MyComp>().OnCreate((kernel,item)=>item.Name="tuna"));
    
Google
Search WWW Search castleproject.org