castle

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

夙愿已清 提交于 2019-12-04 12:19:13
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.? Actually you have several options to create the equivalent of a ViewComponent in ASP.NET MVC, depending in the complexity of your component. I use these two approaches which are the more mvc-ish of the options I am aware of. 1: The simplest thing is to create a ViewUserControl and display it using Html.RenderPartial with the helper. The ViewUserControl is a simple piece of markup with no backing

What is best practise when instantiating a Castle Windsor container in a class library? [duplicate]

和自甴很熟 提交于 2019-12-04 03:31:32
问题 This question already has answers here : Dependency Inject (DI) “friendly” library (4 answers) Closed 3 years ago . I am wondering where the best place to instantiate the castle Windsor container is in a class library. Should I simply do it in the constructor of the class I am using or is there a single entry point for assemblies that I am unaware of? Thanks. 回答1: The configuration of an injected object graph is entirely dependent on the needs of the application that actually uses it. The

How to overwrite a component with castle windsor?

假装没事ソ 提交于 2019-12-03 15:37:18
问题 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) ); Any other Ideas? cheers, Lars 回答1: You could very simply do this in the place you need to override the default implementation. This is an example from our integration tests. Both implementations are now registered but your code will use the default one,

What is best practise when instantiating a Castle Windsor container in a class library? [duplicate]

邮差的信 提交于 2019-12-01 18:00:17
This question already has an answer here: Dependency Inject (DI) “friendly” library 4 answers I am wondering where the best place to instantiate the castle Windsor container is in a class library. Should I simply do it in the constructor of the class I am using or is there a single entry point for assemblies that I am unaware of? Thanks. The configuration of an injected object graph is entirely dependent on the needs of the application that actually uses it. The point of using the container is to be able to configure dependencies at runtime - a library doesn't know anything about how it's

Castle.ActiveRecord环境配置

耗尽温柔 提交于 2019-12-01 08:27:41
在VS Nuget包管理器中将Castle.ActiveRecord下载到项目中 在项目中的app.config中添加如下配置节点 <?xml version="1.0" encoding="utf-8" ?> <configuration> <configSections> <section name="activerecord" type="Castle.ActiveRecord.Framework.Config.ActiveRecordSectionHandler, Castle.ActiveRecord"/> </configSections> <activerecord isWeb="false"> <config> <add key="connection.driver_class" value="NHibernate.Driver.SqlClientDriver" /> <add key="dialect" value="NHibernate.Dialect.MsSql2008Dialect" /> <add key="connection.provider" value="NHibernate.Connection.DriverConnectionProvider" /> <add key="proxyfactory.factory_class" value=

Castle DynamicProxy : How to Proxy Equals when proxying an interface?

末鹿安然 提交于 2019-11-30 09:03:40
I need to use Castle DynamicProxy to proxy an interface by providing an instance of it to ProxyGenerator.CreateInterfaceProxyWithTarget. I also need to make sure that calls to Equals, GetHashCode and ToString hits the methods on the concrete instance, that I am passing, and I can't get that to work. In other words, I'd like this small sample to print True twice, while in fact it prints True,False : using System; using Castle.Core.Interceptor; using Castle.DynamicProxy; public interface IDummy { string Name { get; set; } } class Dummy : IDummy { public string Name { get; set; } public bool

Does Castle-Windsor support ForwardedTypes via XML configuration

妖精的绣舞 提交于 2019-11-30 08:32:30
问题 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? 回答1: [ Update ] This is now possible in Windsor 2.1 or newer. See the documentation for syntax here. This feature has not been implemented in the XML interpreter as of yet.. however it is not difficult to add support for it via a facility (obviously

Castle DynamicProxy : How to Proxy Equals when proxying an interface?

若如初见. 提交于 2019-11-29 13:19:37
问题 I need to use Castle DynamicProxy to proxy an interface by providing an instance of it to ProxyGenerator.CreateInterfaceProxyWithTarget. I also need to make sure that calls to Equals, GetHashCode and ToString hits the methods on the concrete instance, that I am passing, and I can't get that to work. In other words, I'd like this small sample to print True twice, while in fact it prints True,False : using System; using Castle.Core.Interceptor; using Castle.DynamicProxy; public interface IDummy

Will castle bytecode provider for NHibernate 3.2.GA be available in nuget?

梦想与她 提交于 2019-11-29 03:42:29
As you know NHibernate 3.2 has native bytecode provider, which has some breaking changes with castle bytecode provider. For example: public class SomeEntity { public virtual string SomeProperty { get; **private set;**} } Is working fine with NHibernate 3.1 and Castle Bytecode provider. And not in NH 3.2. I'm using nuget for managing my dependencies and do not want to manage them by hands. So my question is: would bytecode providers for castle, linfu and spring be available in nuget? The NHibernate team won't support those bytecode providers any more. It hasn't been officially voted, but I don

NuGet: NHibernate, Castle.Core 3.0 and where is ProxyFactoryFactory?

浪子不回头ぞ 提交于 2019-11-28 09:29:13
I installed with NuGet the packages NHibernate and Castle.Core 3.0 for a new project. Usually we copied around the dlls manually; it is the first time I do that with NuGet. Now I can't find out how to configure the ProxyFactoryFactory, or let's say, I can't find it. I referenced NHibernate and Castle.Core (the only dll I could find in the Castle.Core - package) within the project, and configured the following: <property name="proxyfactory.factory_class"> NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle </property> This leads to: Class Initialization method Tests