public void Register(PandaContainerContext context) { var versionSpecificRequestType = GetVersionSpecificRequestType(context); var requestTypeToRegister = versionSpecificRequestType != null ? versionSpecificRequestType.RequestType : _latestRequestType; _container.RegisterType <T>(requestTypeToRegister); }
private VersionSpecificRequestType GetVersionSpecificRequestType(PandaContainerContext context) { if (context.CurrentBambooVersion == null) { return(null); } return(_versionSpecificRequestTypes .Where(types => types.VersionUpTo >= context.CurrentBambooVersion) .OrderBy(types => types.VersionUpTo) .FirstOrDefault()); }