castle

Do you know how to implement transactions in Castle ActiveRecord?

I decided to make a system for a client using Castle ActiveRecord, everything went well until I found that the transactions do not work, for instance; TransactionScope t = new TransactionScope(); try { member.Save(); //This is just to see transaction wo...

Problem accessing previousState in OnFlushDirty() event of Castle ActiveRecord

I have this problem, I'm using Castle ActiveRecord and when I update I verify changes in the object in the OnFlushDirty event. However, when I access to the previouState["MyProperty"], it turns to be null and I can't get the old value. Do you know why? this is the code; protected override bool OnFlushDirty(object id, System.Colle...

Does Castle Windsor allow the resolution of value types?

I'm trying to pass a parameter into a component that requires a System.TimeSpan. I'm only able to get the 'long ticks' ctor to resolve. Here's a snippet of the config file: <component id="timeInForce" type="System.TimeSpan, mscorlib"> <parameters> <hours>0</hours> <minutes>15</minutes> <seconds>0</seconds> </parameters>...

Does Castle-Windsor support ForwardedTypes via XML configuration

I have a class that implements multiple interfaces. I would like to register these interfaces via XML. All I've found is documentation for the new Fluent Interface. Is this option supported via XML? What would be involved in adding this feature? ...

Does ActiveRecord handle locks and updates?

ActiveRecord doesn't seem to cater for record locking and database updates. How does one synchronise updates in disconnected multi-user environments such as websites and web services? ...

What's your opinion of Castle ActiveRecord?

I need a .Net ORM, and I heard some good things about this. I've had NHibernate running in the past, but this seems to make a lot of things easier. However, two things made me a little nervous. It uses NHibernate 1.2, which seems old It's still an RC with its last release 18 months ago Is anyone using it, and do they recommend it f...

How do you use Castle Validator with Subsonic generated classes?

Castle Validator uses attributes to specify validation rules. How can you hook these up with Subsonic's generated classes (or any classes where you can't define the attributes on)? Is there a way to programatically specify validation rules without using the attribute method? ...

How to overwrite a component with castle windsor?

I want to redefine an (default) implementation in a given windsor-container. Is that what OverWrite is for? Doesn't work, though. container.Register( Component.For<IServiceOperationAuthorization>() .OverWrite() .Instance(_authorization) ); ...

NHibernate proxies prevent Castle.Validator component to do it's job

Hello, everyone! I've run into the problem with NHibernate proxy validation using Castle.Validator component. It's looks like validator could not fetch attributes from entity proxy's properties. I've tried to define validation attributes using Inherited = true while Castle.Validator runner fetch em using following statement: property....

Using Castle for logging thrown exceptions in WCF (and otherwise)

Hello, I'm writing a WCF web service and I'm wondering if there's an elegant (aspect-oriented) way to use Castle interceptor mechanism for logging exceptions thrown by my web methods? I know about the IInterceptor inteface, but I could not find any exception information there. I've seen http://stackoverflow.com/questions/238755/castle...

Is there an equivalent to Monorail view components for the ASP.Net MVC Framework?

I make heavy use of View Components in some of the larger applications I've built in Monorail - What is the equivalent approach in ASP.Net MVC for a view component, that can support sections etc.? ...

where does the build log go when building castle project with nant?

I am trying to build castle project using nant and get output ending in the following: common.compile-dll: [csc] Compiling 92 files to 'C:\code\OSS\castle\build\net-3.5\release\Castle.Core.dll'. [csc] error CS0006: Metadata file 'System.Core.dll' could not be found ...

Mocking internal classes with RhinoMocks

So I have a bunch of internal classes which I am trying to mock with RhinoMocks. I have added the following line to assemblyinfo.cs: [assembly:InternalsVisibleTo(RhinoMocks.StrongName)] However, this still does not allow me to mock internal classes; I get the following error message from NUnit: MyTests.SomeTest: System.TypeLoadE...

How can I change the connection being used by Castle ActiveRecord

I have an application build using ActiveRecord for which there is a new requirement to allow the user to select a database they wish to operate at various times in the course of the running of the application. The database connection is set up in the ActiveRecordStart.Initalize call. I would like to be able to change this connection whe...

Nhibernate.Search is unable to instantiate directory provider

i am trying to use NHibernate.Search together with CastleProjects ActiveRecord as descriped here http://using.castleproject.org/display/AR/Using+NHibernate.Search+with+ActiveRecord but i am getting the following error as soon as i decorate the first buisness object with the indexed attribute Zeile 135: sessFactory = cfg.BuildSessi...

Lazy loading with NHibernate Castle Facility

Do I have to close the ISession's that are generated by Castle's ISessionManager for NHibernate? How do I handle transactions with those ISession's? I'm still quite new to NHibernate. Edit: I would like to have lazy loading but I get this message: Initializing[failed to lazily initialize a collection of role: , no session or ses...

Are there alternative ways to register helpers with controllers in MonoRail?

In MonoRail controllers can be adorned with the Helper attribute to make helpers available in views. Is there another way to register helpers, perhaps via configuration file or dependency injection, with controllers? I'm keen on avoiding creating a base controller just for the purposes of providing helpers and adding yet another controll...

How to detect if a Type is a generated DynamicProxy without referencing Castle DynamicProxy?

I am using castle DynamicProxy and was wondering if there is a way of detecting if a Type is a proxy without referencing Castle DynamicProxy? So while I am using Castle DynamicProxy as an example I would like code that would work for any in memory generated type. var generator = new ProxyGenerator(); var classProxy = generator.Create...

How to get Castle Client Side Validation with xVAl

Has anybody had problems using Castle and Client Side validation? I’ve found that only my numbers (Int, Decimal, Double, etc) gets picked up by ClientSideValidation. Strings, dates, enums and other properties do not. For instance, this class: public class MyClass { [ValidateNonEmpty] public string MyString { get; set; } [ValidateNonE...

CastleWindsor filling the class fields too

I am a beginner using castle windsor; and kinda introduced to it with Apress Pro Mvc book. In the project that I am working at; I use castlewindsor controller factory instead of mvc controller factory; so i can have parametrized constructors and i can inject the dependencies. Is there a way to tell the windsorcontroller factory to inject...