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