コード例 #1
0
        public void Register(PandaContainerContext context)
        {
            var versionSpecificRequestType = GetVersionSpecificRequestType(context);

            var requestTypeToRegister = versionSpecificRequestType != null
                ? versionSpecificRequestType.RequestType
                : _latestRequestType;

            _container.RegisterType <T>(requestTypeToRegister);
        }
コード例 #2
0
        private VersionSpecificRequestType GetVersionSpecificRequestType(PandaContainerContext context)
        {
            if (context.CurrentBambooVersion == null)
            {
                return(null);
            }

            return(_versionSpecificRequestTypes
                   .Where(types => types.VersionUpTo >= context.CurrentBambooVersion)
                   .OrderBy(types => types.VersionUpTo)
                   .FirstOrDefault());
        }