Re: [fluent-nhib] Re: [Proxy] Class hierarchy casting issue

2016-08-11 Thread Rasmus Hansen
You can't cast the proxy. You can cast the proxied object. Therein lies the difference. I try to avoid casting anyways. I'd rather use a visitor pattern as it maintains completeness. On Thu, Aug 11, 2016 at 1:33 PM, mwpowellhtx wrote: > > > On Thursday, August 11, 2016

Re: [fluent-nhib] Re: [Proxy] Class hierarchy casting issue

2016-08-11 Thread Rasmus Hansen
That's exactly Oskar's trick: You call the proxy, into the proxied object and get it to cast itself. cup.Juice.As() Try it. :-) Alternative, you can return the inner, unproxied object, by adding a method like this to the base class: public virtual object UnproxiedObject { get { return this; }

Re: [fluent-nhib] Fluent NHibernate will hopefully get a bugfix release in May

2013-02-12 Thread Rasmus Hansen
Hi, Good news. It has been a while since I looked, but at least it once was true that conventions for components where slightly broken in that you could not access the containing entity. Also, removing clustering from an id would be nice feature, but that's perhaps more a nhib issue. //Ras On

Re: [fluent-nhib] How to map component so that every column that represents a component property will have prefix of component member name?

2012-08-14 Thread Rasmus Hansen
public class MyClassMap : ClassMapMyClass { public MyClassMap() { ... Component(x = x.MyComponent).ColumnPrefix(timeZone); } } On Mon, Aug 13, 2012 at 9:29 PM, gleb Chermennov thebitteren...@gmail.comwrote: Ok, I know the title is not a proper English at all, so let me just show

Re: [fluent-nhib] How to map component so that every column that represents a component property will have prefix of component member name?

2012-08-14 Thread Rasmus Hansen
Ok. I think I understand, if your question is about how to get field access and ComponentMap to work together. That's something that I cannot get to work just like that. It works fine for properties, private properties included. (FNH 1.1) On Tue, Aug 14, 2012 at 9:39 AM, gleb Chermennov

Re: [fluent-nhib] HasOne

2012-07-12 Thread Rasmus Hansen
http://www.jagregory.com/writings/i-think-you-mean-a-many-to-one-sir/ ? On Thu, Jul 12, 2012 at 12:06 PM, Felipe Pinheiro fpcschett...@gmail.comwrote: Good Morning, i have a problem. I have was try to do a system using fluent nhibernate and to map foreignkey in my table Student i used

Re: [fluent-nhib] Subclassmap + Inverse

2012-07-11 Thread Rasmus Hansen
The type of HasMany (EmployeeHomeAddress) needs a reference to its parent, i.e. the EmployeeHomeAddress map must have something like References(x = x.Employee); In a sense EmployeeHomeAddress owns the relationship between Employee and EmployeeHomeAddress //Ras On Wed, Jul 11, 2012 at 6:22