ZUGFeRDRESTService: Use FilterPropertyMap function, fix no type found error

This commit is contained in:
Jonathan Jenne 2023-02-28 13:51:40 +01:00
parent 2f11b7082b
commit 22c7fe8fe2

View File

@ -99,13 +99,13 @@ namespace ZUGFeRDRESTService.Controllers
_AllowXRechnung = false; _AllowXRechnung = false;
} }
if (!bool.TryParse(oZugferdConfig["Zugferd2x"], out _AllowZugferd2x)) if (!bool.TryParse(oZugferdConfig["AllowZugferd2x"], out _AllowZugferd2x))
{ {
_logger.Info("Configuration Zugferd2x was not set. Using default value [{0}]", false); _logger.Info("Configuration Zugferd2x was not set. Using default value [{0}]", false);
_AllowZugferd2x = false; _AllowZugferd2x = false;
} }
if (!bool.TryParse(oZugferdConfig["Zugferd10"], out _AllowZugferd10)) if (!bool.TryParse(oZugferdConfig["AllowZugferd10"], out _AllowZugferd10))
{ {
_logger.Info("Configuration Zugferd10 was not set. Using default value [{0}]", true); _logger.Info("Configuration Zugferd10 was not set. Using default value [{0}]", true);
_AllowZugferd10 = true; _AllowZugferd10 = true;
@ -151,9 +151,7 @@ namespace ZUGFeRDRESTService.Controllers
_logger.Info("Detected Specification was: [{0}]", oZugferdResult.Specification); _logger.Info("Detected Specification was: [{0}]", oZugferdResult.Specification);
var oFilteredPropertyMap = _propertyMap. var oFilteredPropertyMap = _zugferd.FilterPropertyMap(_propertyMap, oZugferdResult.Specification);
Where(kv => kv.Value.Specification == oZugferdResult.Specification).
ToDictionary(kv => kv.Key, kv => kv.Value);
if (oFilteredPropertyMap.Count == 0) if (oFilteredPropertyMap.Count == 0)
{ {