gpt4 book ai didi

asp.net - 之间的区别

转载 作者:行者123 更新时间:2023-12-02 07:01:47 26 4
gpt4 key购买 nike

我不确定我是否理解 web.config 元素之间的区别 <endpointBehaviors><serviceBehaviors> (当然还有邻近的行为)。

最佳答案

来自here :

  1. ServiceBehavior applies only on service while EndpointBehavior applies on both client and service.

  2. ServiceBehavior can be specified via config/attribute/code while endpointbehavior can be specified via config/code.

  3. ServiceBehavior has access to all ServiceEndpoints dispatch runtime and so could modify all dispatch runtimes while Endpointbehavior gets called with the runtime for that endpoint only.

Look at it this way, ServiceBehavior lets you access runtime parameters for all endpoints while Endpointbehavior lets you access runtime components only for that endpoint. So if you have a need to extend functionality that spawns the entire contract (or multiple contracts) then use ServiceBehavior and if you are interested in extending one specific endpoint then use Endpointbehavior.

还有MSDN可以随时引用以获取详细信息:

<endpointBehaviors> This configuration section represents all the behaviors defined for a specific endpoint.

<serviceBehaviors> This configuration section represents all the behaviors defined for a specific service.

一个很好的 MSDN 引用:Configuring and Extending the Runtime with Behaviors

关于asp.net - <endpointBehaviors> 和 <serviceBehaviors> 之间的区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34526228/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com