castle

nhibernate not taking mappings from assembly

Hi I'm using fnh and castle nhib facility. I followed the advice from mike hadlow here: http://mikehadlow.blogspot.com/2009/01/integrating-fluent-nhibernate-and.html here is my FluentNHibernateConfigurationBuilder: public Configuration GetConfiguration(IConfiguration facilityConfiguration) { var defaultConfigurationBuild...

Binding Monorail RadioFields to GenericLists

I have the following object which I bind to a Form in my view: public class Foo { public List<Bar> Items { get; set; } } public class Bar { public List<string> Lines { get; set; } public int Resolution { get; set; } } I am presenting this information to the user as various groups of RadioFields. How do I bind the Radio...

How to handle XSS on NVelocity

Castle Project is full of features, includes some awesome subprojects, and developing with it has been a pleasure. My team is almost ready to deliver a custom made EAM and we are polishing our system. We tried some basic XSS attacks and guess: They all worked. Even though it will be running in a Intranet environment, we wouldn't like u...

[c#] Unity: Build up a dictionary

Hi, I'm converting a Castle/Monorails application into a Unity/Asp.NET MVC one, I'm stuck in trying to converting this component configuration: <component id="ComponentBaseConfiguration" service="MyFakeNamespace.BOL.IConfiguration, MyFakeAppDll" type="MyFakeNamespace.BOL.ConfigurableConfiguration, MyFakeAppDll"> <parameters> ...

Using MVC and fluent Nhibernate, how do I validate unique fields on my ViewModel before I bind them to my Domain Object and Save them?

I have a website where I allow users to create new Part records. I'm trying to figure out the best way to validate specific fields for uniqueness. I want to make sure that somebody doesn't try to add a Part with PartNumber 1234 if that PartNumber already exists on a different Part. The Web Application is using Asp.net MVC with fluen...

Mark "deleted" instead of physical deletion with Castle ActiveRecord.

In my current project, we got a rather unusual request(to me). The client wants all the deletion procedure to mark a flag instead of physically delete the record from the database table. It looks pretty easy at the first glance. I just have change public void DeleteRecord(Record record) { record.DeleteAndFlush(); } public IList G...

How to get reference to SqlConnection (or Connection string) in Castle ActiveRecord?

how can I get reference to current SqlConnection or Sqlconnection in config? I found http://svn.castleproject.org:8080/svn/castle/trunk/ActiveRecord/Castle.ActiveRecord.Tests/DifferentDatabaseScopeTestCase.cs and code private string GetSqlConnection() { IConfigurationSource config = GetConfigSource(); ...

Implementing INotifyPropertyChanged or similar custom event in base class

Is there a way to do this: I need to develop the easiest way to support registering to property changes of some class. Apart from manual way of adding INotifyProperyChanged support, is there a way to do it like this: class Base ... // all notification logic here class Child { public string Name { get; set; } public int SomeNu...

Castle ActiveRecord "Could not compile the mapping document: (string)"

Hi I am having getting an exception when trying to initialize ActiveRecord and I cannot figure out what I am missing. I am trying to convince the company I work for to use Castle ActiveRecord and it won't look good if I can't demonstrate how it works. I have work on projects before with Castle ActiveRecord and I had never experience this...

Castle ActiveRecord: one-to-one

While playing around with one-to-one associations in castle activerecord I stumbled upon the following problem: I'm trying to model a one-to-one relationship (user-userprofile in this case). I already learned that this may not be a best practice, but let's ignore that for a moment (I'm still trying to understand what's going on). [Acti...

can you use castle dynamic proxies on web services references?

Hi, Is it possible to create a dynamic proxy on the a web service reference that has been added to a visual studio project? I've added the web service reference in the normal way and tried to create a dynamic proxy using castle to wrap the method invocation in a try/catch to translate any SoapExceptions, but on running it I'm getting a ...

castle IOC - resolving circular references

Hi quick question for my MVP implementation: currently I have the code below, in which both the presenter and view are resolved via the container. Then the presenter calls View.Init to pass himself to the view. I was wondering however if there is a way to let the container fix my circular reference (view -> presenter, presenter -> vie...

Where is the castle dynamicproxy repo?

I can't seem to find the repo for castle dynamic proxy? I found the code on http://sourceforge.net/projects/castleproject/ I need to fix it so it works in medium trust. It seems the caste.core assembly needs the allowpartically... attribute in the assembly.cs file. ...

help building castle dynamic proxy

So I pulled the source from https://svn.castleproject.org/svn/castle/DynamicProxy/trunk/ Open it up in vs.net 2008 problems: vs.net can't open the assembly.cs assembly signing failed What am I doing, rather NOT doing? Update So I downloaded nant, setup the .bat file in my PATH so it works in cmd prompt. I ran: nant default.buil...

After upgrading to Castle Trunk and NHibernate 2.1.0.4000 My Integration tests crash TestDriven.Net

I have an old MonoRail/ActiveRecord I've been doing some work too. Recently I decided to upgrade the application to Castle Trunk & NHibernate 2.1.0.4000 GA and I'm now finding a few issues with running tests: First off - When using TestDriven.Net to run the integration tests that work against the database, it's crashing TestDriven.Net ...

Objects validating itself using Castle Validators

hi, I have a Task object which has a property of Employee. Im trying to find the best possible way setting a validation to only allow the certain employees to access the task object. If the current context user (web/winforms) tries to instantiate the Task object the object should automatically validate itself and return a validation er...

ASP.Net MVC 2.0 Client Validation with Castle Validators

Hi there, Im trying to implement a client and server validation for my webapplication using castle valitors.Has anyone got any examples of how to use Castle Validators with ASP.net mvc v2 Client validation. ...

Validation Runner for Castle (or NHibernate) with Buddy Class Support

I'm using the wonderful xVal library for setting up client side validation of rules defined server side in ASP.NET MVC. In my implementation I need buddy classes since I'm extending classes already defined by entity framework. (I recognize that MVC2 may make all this moot, but I'm staying in MVC1 until 2 goes live). The DataAnnota...

Downloading Castle.Core and adding [AllowPatiallyTrustedCallers]

I want to run Castle.Core under medium trust, and I know how to do it in theory. Add [AllowPatiallyTrustedCallers] to the Assembly.cs Disable Trace Logger - (because it uses reflection) First problem, there is is no Assembly.cs, so apparently you can use nant to build with a command line like: nant -D:assembly.allow-partially-trust...

How do I create different sessions for different windows in a desktop application with ActiveRecord?

I'm building a desktop application with Castle ActiveRecord and want to be able to do the equivalent of 1 nHibernate session per window form. Any ideas on how can I do this with Active Record? Specifically, I have a main window that allows you to browse the data (read-only) and then you can open separate forms to edit the data. Each...