Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS will be completely phased out by mid-2025. To see alternatives please check here

Skip to content
Snippets Groups Projects
Commit 52261baf authored by Markus Quaritsch's avatar Markus Quaritsch
Browse files

if declaration-data file cannot be found, use included resource

parent 568f2bc7
No related branches found
No related tags found
No related merge requests found
......@@ -65,12 +65,14 @@ namespace TUGraz.VectoCore.Models.Declaration
//#if USE_EXTENAL_DECLARATION_DATA
var tmp = resourceId.Replace(DeclarationData.DeclarationDataResourcePrefix + ".", "");
var parts = tmp.Split('.');
return
VectoCSVFile.Read(Path.Combine("Declaration", string.Join(".", parts[parts.Length - 2], parts[parts.Length - 1])
));
//#else
// return VectoCSVFile.ReadStream(RessourceHelper.ReadStream(resourceId), source: resourceId);
//#endif
var fileName = Path.Combine("Declaration", string.Join(".", parts[parts.Length - 2], parts[parts.Length - 1]));
if (File.Exists(fileName)) {
return VectoCSVFile.Read(fileName);
}
//#else
return VectoCSVFile.ReadStream(RessourceHelper.ReadStream(resourceId), source: resourceId);
//#endif
}
protected static void NormalizeTable(DataTable table)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment