Example #1
0
        public void AddContextualRepeat()
        {
            var container = new Container();
            var bindData  = new BindData(container, "AddContextualRepeat", (app, param) => "hello world", false);

            bindData.AddContextual("service", "service given");
            ExceptionAssert.Throws <RuntimeException>(() =>
            {
                bindData.AddContextual("service", "service given");
            });
        }
Example #2
0
 /// <summary>
 /// 给与什么服务
 /// </summary>
 /// <param name="service">给与的服务名或别名</param>
 /// <returns>服务绑定数据</returns>
 public IBindData Given(string service)
 {
     Guard.NotEmptyOrNull(service, "service");
     return(bindData.AddContextual(needs, service));
 }