Example #1
0
        private object CreateHandler(BackgroundTask task)
        {
            try
            {
                var handlerInfo = Serializer.Deserialize <HandlerInfo>(task.Handler);

                var typeName = $"{handlerInfo.Namespace}.{handlerInfo.Entrypoint}";
                var type     = _typeResolver.FindByFullName(typeName) ?? _typeResolver.FindFirstByName(typeName);
                return(type == null ? null : _backgroundServices.AutoResolve(type));
            }
            catch (Exception e)
            {
                _logger.Error(() => "Error creating handler for task", e);
                throw;
            }
        }