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"); }); }
/// <summary> /// 给与什么服务 /// </summary> /// <param name="service">给与的服务名或别名</param> /// <returns>服务绑定数据</returns> public IBindData Given(string service) { Guard.NotEmptyOrNull(service, "service"); return(bindData.AddContextual(needs, service)); }