public void Attach(TemplateContract templateContract) { if (templateContract == null) { throw new ArgumentNullException(nameof(templateContract)); } var type = templateContract.GetType(); TemplateContractInfos.GetValueOrCreate(type, () => new TemplateContractInfo(type)).Bind(templateContract, _templateChildProvider); }
public void Detach(TemplateContract templateContract) { TemplateContractInfos.GetValueOrDefault(templateContract.GetType())?.Unbind(templateContract); }