use coalesce condition
This commit is contained in:
parent
a07907b33c
commit
95f958c29e
@ -42,9 +42,7 @@ namespace dopt.DeltaBarth
|
|||||||
{
|
{
|
||||||
pyJson = pyModPipeline.pipeline_sales_forecast_dummy(firmaId, buchungsDatum);
|
pyJson = pyModPipeline.pipeline_sales_forecast_dummy(firmaId, buchungsDatum);
|
||||||
}
|
}
|
||||||
var parsed = JsonSerializer.Deserialize<DataObjects.UmsatzPrognoseAusgabe>(pyJson);
|
var parsed = JsonSerializer.Deserialize<DataObjects.UmsatzPrognoseAusgabe>(pyJson) ?? throw new PythonParsingException("Could not correctly parse object from Python");
|
||||||
if (parsed == null) { throw new PythonParsingException("Could not correctly parse object from Python"); }
|
|
||||||
|
|
||||||
return parsed;
|
return parsed;
|
||||||
}
|
}
|
||||||
public DataObjects.UmsatzPrognoseAusgabe Umsatzprognose(int? firmaId, DateTime? buchungsDatum)
|
public DataObjects.UmsatzPrognoseAusgabe Umsatzprognose(int? firmaId, DateTime? buchungsDatum)
|
||||||
@ -55,9 +53,7 @@ namespace dopt.DeltaBarth
|
|||||||
{
|
{
|
||||||
pyJson = pyModPipeline.pipeline_sales_forecast(firmaId, buchungsDatum);
|
pyJson = pyModPipeline.pipeline_sales_forecast(firmaId, buchungsDatum);
|
||||||
}
|
}
|
||||||
var parsed = JsonSerializer.Deserialize<DataObjects.UmsatzPrognoseAusgabe>(pyJson);
|
var parsed = JsonSerializer.Deserialize<DataObjects.UmsatzPrognoseAusgabe>(pyJson) ?? throw new PythonParsingException("Could not correctly parse object from Python");
|
||||||
if (parsed == null) { throw new PythonParsingException("Could not correctly parse object from Python"); }
|
|
||||||
|
|
||||||
return parsed;
|
return parsed;
|
||||||
}
|
}
|
||||||
protected void Setup(string datenPfad, string basisApiUrl)
|
protected void Setup(string datenPfad, string basisApiUrl)
|
||||||
@ -98,9 +94,7 @@ namespace dopt.DeltaBarth
|
|||||||
}
|
}
|
||||||
|
|
||||||
DataObjects.Credentials? parsed = JsonSerializer.Deserialize<DataObjects.Credentials>(pyJson);
|
DataObjects.Credentials? parsed = JsonSerializer.Deserialize<DataObjects.Credentials>(pyJson);
|
||||||
if (parsed == null) { throw new PythonParsingException("Could not correctly parse object from Python"); }
|
return parsed ?? throw new PythonParsingException("Could not correctly parse object from Python");
|
||||||
|
|
||||||
return parsed;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user