Thanks Jose. I didn't know about this, it opens some interesting
options. Unfortunately IDataContractSurrogate isn't available in
SIlverlight.

Thanks

On Oct 19, 11:32 pm, José F. Romaniello <[email protected]>
wrote:
> You should use WCF extensions point in that secenario rather than Nhibernate
> extensions point.
> You could use dynamicproxy in the desserialization proccess.
> Have a look to IDataContractSurrogate. GetDesearilizedObject method.
>
> BTW, Castle DP is compatible with silverlight
>
> 2009/10/19 Miguel <[email protected]>
>
>
>
> > I thought this is not necessarily an NHibernate problem, but related
> > to this issue.
>
> > In WPF or Silverlight, we need to implement those interfaces, this
> > dynamic proxy generation works great and we have the right hooks in
> > NHibernate to do it, but Do you know how to do something similar if we
> > need to send the entities through the wire and then deserialize it
> > (using WCF). AFAIK, since WCF creates the instance, we don't have a
> > way to use our behaviours. Do you know about any solutions for this?
>
> > On Oct 19, 9:09 am, José F. Romaniello <[email protected]>
> > wrote:
> > > I agree with Fabio.
> > > BUT it is fairly easy, create a custom IBehaviorStore as follows:
>
> > > public class AttributeBehaviorStore : IBehaviorStore
> > > {
> > >     public ICollection<Type> GetBehaviorsForType(Type type)
> > >     {
> > >         //type.GetAttributes...
> > >         //if type has the attrib NotifyChangeAttribute
> > >         //return a Colection
> > >             //containing typeof(NotifyPropertyChangedBehavior)
>
> > >     }
>
> > >     public BehaviorList For<TType>()
> > >     {
> > >             throw new NotImplementedException()
> > >     }
>
> > > }
>
> > > You doesn't need to implement the second method, BTW, I will remove from
> > the
> > > interface soon.
>
> > > 2009/10/18 Fabio Maulo <[email protected]>
>
> > > > Too much invasion.
>
> > > > 2009/10/18 LasseL <[email protected]>
>
> > > >> Another thing raised to my mind...... regarding configuration of
> > > >> Entitys. A lot of typing for "basic" stuff.
> > > >> Is it possible to configure using reflection??
> > > >> Like ..  (syntax not correct).
>
> > > >> [Use NotofyPropertyChanged Event]
> > > >> public class Customer
> > > >> {
>
> > > >> }
>
> > > >> //lasse
>
> > > >> On 18 Okt, 18:24, José F. Romaniello <[email protected]> wrote:
> > > >> > This post is very interesting to me and I'll catalogue as the first
> > > >> > interesting question to my work.
> > > >> > For the first answer about MEF, what can I say? I think you could
> > use
> > > >> both..
> > > >> > Or, create a new one that use only the dynamicproxy part of castle,
> > and
> > > >> do
> > > >> > all the injection with MEF.
>
> > > >> > And the second question, regarding to fire the event if the value
> > > >> doesn't
> > > >> > change. I had a conflict of ideas in that part, but I'm almost
> > decided
> > > >> to do
> > > >> > as you say. I'll commit that change this week.
>
> > > >> > 2009/10/18 LasseL <[email protected]>
>
> > > >> > > Hi
>
> > > >> > > Now I have a small project running,,, so far I only implemented
> > > >> > > INotifyPropertyChanged.The next step for me is to implement
> > > >> > > IDataError.
>
> > > >> > > In my application,, where I run into problem (my first post) I
> > using
> > > >> > > MEF. This heavly depends on Castle. Is it a big problem go to MEF
> > or
> > > >> > > is it better to convert all to Castle.
>
> > > >> > > Another question...In one of your post,,, you says that you would
> > like
> > > >> > > to avoid things like:
>
> > > >> > > public string MyString
> > > >> > > {
> > > >> > > get {return _MyString;}
> > > >> > > set {
> > > >> > >          if (! _MyString.Equals(value) )
> > > >> > >              _MyString = value;
> > > >> > >      }
> > > >> > > }
>
> > > >> > > My question is,,,
> > > >> > > Looking on other peoples example, they actually wants this kind of
> > > >> > > constructs, to avoid to many INotifyPropertyChanged events (I
> > > >> > > guess....)
> > > >> > > Also,, this kind of construct makes it easy to implement  a
> > "Dirty"
> > > >> > > flag.
>
> > > >> > > Any ideas around this????
>
> > > >> > > //lass
>
> > > >> > > On 17 Okt, 20:28, José F. Romaniello <[email protected]>
> > > >> wrote:
> > > >> > > > This "OnCreateFacility" is... pretty new. Do you use the trunk
> > > >> version
> > > >> > > > of castle? If not checkout.. or copy libs from the
> > > >> chinookmediamanger
> > > >> > > > sample.
>
> > > >> > > > On 17 oct, 15:21, LasseL <[email protected]> wrote:
>
> > > >> > > > > Ok
>
> > > >> > > > > I vill look into this, and create a database.
>
> > > >> > > > > I've started a small project based on this. Purpose is to
> > learn to
> > > >> use
> > > >> > > > > nHAddins. First I would like to get INotifyPropertyChanged to
> > > >> work,,
> > > >> > > > > then add on functionality.
>
> > > >> > > > > Of course I ran into problems...
>
> > > >> > > > > This line:
> > > >> > > > > using Castle.MicroKernel.Facilities.OnCreate   seems to cause
> > > >> trouble
> > > >> > > > > for me,, or at least when the code are trying to use OnCreate.
>
> > > >> > > > > Looking into Castle.MicroKernel   i cant find
> > > >> Facilities.OnCreate...
>
> > > >> > > > > Of course,, I am not good at searching but I am also afraid
> > that
> > > >> this
> > > >> > > > > is more than I can understan,,, I am a real newbee at this.
>
> > > >> > > > > Any advise??
>
> > > >> > > > > On 17 Okt, 16:50, José F. Romaniello <[email protected]>
> > > >> wrote:
>
> > > >> > > > > > >I havent been able to
> > > >> > > > > > >find any,,, but my wife tells me I'm bad at serarching ...
> > :)
>
> > > >> > > > > > She's right. And reading errors too, LOL. (its a joke).
> > > >> > > > > > But let me explain,
>
> > > >> > > > > > Have look the inner exception:
> > > >> > > > > > InnerException: System.Data.SqlClient.SqlException
> > > >> > > > > >                 Message="Cannot open database \"Chinook\"
> > > >> requested
> > > >> > > > > > by the login. The login failed.\r\nLogin failed for user
> > > >> 'PREVAS\
> > > >> > > > > > \lgli'."
>
> > > >> > > > > > You need to create the database, and that is explained in
> > the
> > > >> > > documentation:
>
> >http://nhforge.org/blogs/nhibernate/archive/2009/08/15/introducing-nh.
> > > >> ..
>
> > > >> > > > > > BTW have a look to my other post about chinook in nhforge.
>
> > > > --
> > > > Fabio Maulo
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to