fluent

Is there is a fluent approach to handling WinForm event?

I was handling yet another KeyDown event in a user control when I wondered if it existed a library for typing fluent code for handling event like editor.When(Keys.F).IsDown().With(Keys.Control).Do((sender, e) => ShowFindWindow()); Does that exist? ...

Generic 'TThis' for fluent classes

I'm constructing a fluent interface where I have a base class that contains the bulk of the fluent logic, and a derived class that add some specialized behavior. The problem I'm facing is the return type of the fluent methods in the base class when called from an instance of the derived type. After invoking a method of the base class, on...

How to update a specific fields of class in Fluent NHibernate with out updating the whole object?

Hi, I am using Fluent NHibernate to do my NHibernate mappings, but now I have come to a problem that I am not sure how to solve. A simplified version of the problem follows. I have a user class: public class User { public virtual int Id { get; set; } public virtual string FirstName { get; set; } public virtual string Last...

How to change schema with Fluent NHibernate AutoMapping

In my database every table belongs to a schema (Person for example.) I am using Fluent NHibernate with Automapping and my question is how I set the schema I want to use. ...

Fluent NHibernate PersistenceSpecification CheckList

I am currently working on a college project in which we are using Fluent NHibernate. I am working on figuring how to create testing for our entities and Fluent mappings. I have, however, hit a dead end while trying to figure how to use the CheckList of PersistenceSpecification. The unit test fails with the following error: MvcShop.Cor...

NHibernate extract DBTransaction from Session

Hi there, I have an legacy db where some stored proc calculates the row ids for all the tables. Now I want to overwrite the IIdentifierGenerator as hinted at this page http://www.richter-web.info/Wordpress/?p=132 just to avoid the Id(x => x.id).GenereatedBy.Assigned. Now as I save some object,of course inside an Nhibernate transaction,...

Is there a workaround for the unsupported IParameterizedType in Fluent NHibernate?

Fluent NHibernate is currently unable to use the IParameterizedType of a CustomType but I need to use the fluent mapping because I want to adjust the mapping within my code. Is there a workaround for Fluent NHibernate that somehow injects the XML elements that would be used within the normal mapping XML-file? I did already find the sim...

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...

Windsor Fluent Registration - All types in an assembly

I wanted to use the fluent interface in Castle Windsor. Since this isn't available in the "release" binaries for .NET 2.0 I compiled from trunk, which is reported to be fairly stable. I compiled just: Castle.Core.dll Castle.DynamicProxy.dll Castle.MicroKernel.dll Castle.Windsor.dll This should be all that is necessary for what I need...

No persister for Entity

I define a simple Bug Class: using System; namespace BugNS.Entities { class Bug { public virtual int Id { get; private set; } public virtual int BugNumber { get; set; } } } and a simple mapper class: using System; using FluentNHibernate.Mapping; using BugNS.Entities; namespace BugNS.Mappings { class ...

Fluent log4net configuration

Anyone know if there's a fluent way of configuring log4net (appenders and all the properties for appenders etc...). The xml is driving me crazy. Or if not, does anyone know of a decent .Net logging framework that can easily be fluently configured and offer similar features to log4net? ...

Fluent nhibernate automapping - how to order columns

With Fluent mapping it was easy, the order of definition is the order of schema creation. With auto mapping it is different. Does anyone know how to set the order of generated columns? Thanks. ...

Fluent Nhibernate Oracle Identifier Too Long - Alias Name Issue

I've tried to do that. HasManyToMany<YechidotDoarInGroup>(x => x.Col_yig) .Table("PigToYig") .ChildKeyColumn("YIG_GROUP_RECID") .ParentKeyColumn("PIG_GROUP_RECID"); but I've got ORA-00942: table or view does not exist I am trying to establish HasManyToMany conn...

Method chaining and the finishing problem

Hi, are there any approaches, given a statement like the following First().Second(); to know from within First() whether/when Second() has executed? Reference: http://martinfowler.com/dslwip/MethodChaining.html ...

How do I map Join tables with fluent auto mapping?

Here are my classes: public abstract class TypeBase { public virtual int? Id { get; set; } public virtual string Name { get; set; } } // various other classes extend TypeBase the same way public class Color : TypeBase { } public class Template { public virtual int? Id { get; set; } public virtual IList<Style...

Fluent Nhibernate Conventions

I'm trying to adapt these conventions for my project. Not-Null as the default Varchar instead of nvarchar I attempted the first one using the following code. However, it didn't work. public void Accept(IAcceptanceCriteria<FluentNHibernate.Conventions.Inspections.IPropertyInspector> criteria) { criteria.Expect(c => c....

fluent nhibernate automap version column

Current code in my convention: public void Apply(FluentNHibernate.Conventions.Instances.IVersionInstance instance) { instance.Column("RowVersion"); instance.Not.Nullable(); instance.UnsavedValue("0"); instance.Default(1); } This doesn't render the RowVersion as a version column. It treats Ro...

Fluent NHibernate join single column from another table

Hi, I'm using Fluent NHibernate and have two tables; Customer [ID, Name, LanguageID] Languages [ID, Description] I have a Customer entity with the following properties; ID, Name, LanguageID, Language What I would like to do is to join to the Languages table to get the language description and put it in the language property of the c...

How do I override the automapping for a composite Id, one to many relationship with fluent nhibernate?

I'm polling mulitple systems (domains) for security info so I'm dealing domainUsers and their roles. I've got my entities setup as show below, but I'm having trouble setting up the domainUser.HasMany relationship in the AutoMapper override. You'll notice that I don't have domainUser.DomainUserId and role.RoleId which make this much m...

NHibernate taking a long time to run query

This is being done using Fluent NHibernate I've got a NHibernate lookup that is retrieving data from one table. If i take the generated sql and run it through query analyzer, it takes ~18ms to run. Using NHProfiler, i'm getting the duration of this query as ~1800ms - 100 times longer than sql ! Query duration - Database only:1800ms...