Skip to content

Commit 993ffc5

Browse files
committed
Merge pull request #149 from eriove/feature/missing-nullable-constructors
Regenerated code with missing nullable constructors
2 parents 8d2f5d1 + e63cf4e commit 993ffc5

File tree

4 files changed

+323
-0
lines changed

4 files changed

+323
-0
lines changed

UnitsNet/GeneratedCode/UnitClasses/Angle.g.cs

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,21 @@ public static Angle FromRadians(double radians)
362362
}
363363
}
364364

365+
/// <summary>
366+
/// Get nullable Angle from nullable Microdegrees.
367+
/// </summary>
368+
public static Angle? FromMicrodegrees(double? microdegrees)
369+
{
370+
if (microdegrees.HasValue)
371+
{
372+
return FromMicrodegrees(microdegrees.Value);
373+
}
374+
else
375+
{
376+
return null;
377+
}
378+
}
379+
365380
/// <summary>
366381
/// Get nullable Angle from nullable Microradians.
367382
/// </summary>
@@ -377,6 +392,21 @@ public static Angle FromRadians(double radians)
377392
}
378393
}
379394

395+
/// <summary>
396+
/// Get nullable Angle from nullable Millidegrees.
397+
/// </summary>
398+
public static Angle? FromMillidegrees(double? millidegrees)
399+
{
400+
if (millidegrees.HasValue)
401+
{
402+
return FromMillidegrees(millidegrees.Value);
403+
}
404+
else
405+
{
406+
return null;
407+
}
408+
}
409+
380410
/// <summary>
381411
/// Get nullable Angle from nullable Milliradians.
382412
/// </summary>
@@ -392,6 +422,21 @@ public static Angle FromRadians(double radians)
392422
}
393423
}
394424

425+
/// <summary>
426+
/// Get nullable Angle from nullable Nanodegrees.
427+
/// </summary>
428+
public static Angle? FromNanodegrees(double? nanodegrees)
429+
{
430+
if (nanodegrees.HasValue)
431+
{
432+
return FromNanodegrees(nanodegrees.Value);
433+
}
434+
else
435+
{
436+
return null;
437+
}
438+
}
439+
395440
/// <summary>
396441
/// Get nullable Angle from nullable Nanoradians.
397442
/// </summary>
@@ -491,10 +536,16 @@ public static Angle From(double value, AngleUnit fromUnit)
491536
return FromDegrees(value.Value);
492537
case AngleUnit.Gradian:
493538
return FromGradians(value.Value);
539+
case AngleUnit.Microdegree:
540+
return FromMicrodegrees(value.Value);
494541
case AngleUnit.Microradian:
495542
return FromMicroradians(value.Value);
543+
case AngleUnit.Millidegree:
544+
return FromMillidegrees(value.Value);
496545
case AngleUnit.Milliradian:
497546
return FromMilliradians(value.Value);
547+
case AngleUnit.Nanodegree:
548+
return FromNanodegrees(value.Value);
498549
case AngleUnit.Nanoradian:
499550
return FromNanoradians(value.Value);
500551
case AngleUnit.Radian:

UnitsNet/GeneratedCode/UnitClasses/Flow.g.cs

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,21 @@ public static Flow FromUsGallonsPerMinute(double usgallonsperminute)
256256
}
257257

258258

259+
/// <summary>
260+
/// Get nullable Flow from nullable CentilitersPerMinute.
261+
/// </summary>
262+
public static Flow? FromCentilitersPerMinute(double? centilitersperminute)
263+
{
264+
if (centilitersperminute.HasValue)
265+
{
266+
return FromCentilitersPerMinute(centilitersperminute.Value);
267+
}
268+
else
269+
{
270+
return null;
271+
}
272+
}
273+
259274
/// <summary>
260275
/// Get nullable Flow from nullable CubicFeetPerSecond.
261276
/// </summary>
@@ -301,6 +316,36 @@ public static Flow FromUsGallonsPerMinute(double usgallonsperminute)
301316
}
302317
}
303318

319+
/// <summary>
320+
/// Get nullable Flow from nullable DecilitersPerMinute.
321+
/// </summary>
322+
public static Flow? FromDecilitersPerMinute(double? decilitersperminute)
323+
{
324+
if (decilitersperminute.HasValue)
325+
{
326+
return FromDecilitersPerMinute(decilitersperminute.Value);
327+
}
328+
else
329+
{
330+
return null;
331+
}
332+
}
333+
334+
/// <summary>
335+
/// Get nullable Flow from nullable KilolitersPerMinute.
336+
/// </summary>
337+
public static Flow? FromKilolitersPerMinute(double? kilolitersperminute)
338+
{
339+
if (kilolitersperminute.HasValue)
340+
{
341+
return FromKilolitersPerMinute(kilolitersperminute.Value);
342+
}
343+
else
344+
{
345+
return null;
346+
}
347+
}
348+
304349
/// <summary>
305350
/// Get nullable Flow from nullable LitersPerMinute.
306351
/// </summary>
@@ -316,6 +361,36 @@ public static Flow FromUsGallonsPerMinute(double usgallonsperminute)
316361
}
317362
}
318363

364+
/// <summary>
365+
/// Get nullable Flow from nullable MicrolitersPerMinute.
366+
/// </summary>
367+
public static Flow? FromMicrolitersPerMinute(double? microlitersperminute)
368+
{
369+
if (microlitersperminute.HasValue)
370+
{
371+
return FromMicrolitersPerMinute(microlitersperminute.Value);
372+
}
373+
else
374+
{
375+
return null;
376+
}
377+
}
378+
379+
/// <summary>
380+
/// Get nullable Flow from nullable MillilitersPerMinute.
381+
/// </summary>
382+
public static Flow? FromMillilitersPerMinute(double? millilitersperminute)
383+
{
384+
if (millilitersperminute.HasValue)
385+
{
386+
return FromMillilitersPerMinute(millilitersperminute.Value);
387+
}
388+
else
389+
{
390+
return null;
391+
}
392+
}
393+
319394
/// <summary>
320395
/// Get nullable Flow from nullable MillionUsGallonsPerDay.
321396
/// </summary>
@@ -331,6 +406,21 @@ public static Flow FromUsGallonsPerMinute(double usgallonsperminute)
331406
}
332407
}
333408

409+
/// <summary>
410+
/// Get nullable Flow from nullable NanolitersPerMinute.
411+
/// </summary>
412+
public static Flow? FromNanolitersPerMinute(double? nanolitersperminute)
413+
{
414+
if (nanolitersperminute.HasValue)
415+
{
416+
return FromNanolitersPerMinute(nanolitersperminute.Value);
417+
}
418+
else
419+
{
420+
return null;
421+
}
422+
}
423+
334424
/// <summary>
335425
/// Get nullable Flow from nullable UsGallonsPerMinute.
336426
/// </summary>
@@ -401,16 +491,28 @@ public static Flow From(double value, FlowUnit fromUnit)
401491
}
402492
switch (fromUnit)
403493
{
494+
case FlowUnit.CentilitersPerMinute:
495+
return FromCentilitersPerMinute(value.Value);
404496
case FlowUnit.CubicFootPerSecond:
405497
return FromCubicFeetPerSecond(value.Value);
406498
case FlowUnit.CubicMeterPerHour:
407499
return FromCubicMetersPerHour(value.Value);
408500
case FlowUnit.CubicMeterPerSecond:
409501
return FromCubicMetersPerSecond(value.Value);
502+
case FlowUnit.DecilitersPerMinute:
503+
return FromDecilitersPerMinute(value.Value);
504+
case FlowUnit.KilolitersPerMinute:
505+
return FromKilolitersPerMinute(value.Value);
410506
case FlowUnit.LitersPerMinute:
411507
return FromLitersPerMinute(value.Value);
508+
case FlowUnit.MicrolitersPerMinute:
509+
return FromMicrolitersPerMinute(value.Value);
510+
case FlowUnit.MillilitersPerMinute:
511+
return FromMillilitersPerMinute(value.Value);
412512
case FlowUnit.MillionUsGallonsPerDay:
413513
return FromMillionUsGallonsPerDay(value.Value);
514+
case FlowUnit.NanolitersPerMinute:
515+
return FromNanolitersPerMinute(value.Value);
414516
case FlowUnit.UsGallonsPerMinute:
415517
return FromUsGallonsPerMinute(value.Value);
416518

UnitsNet/GeneratedCode/UnitClasses/ForceChangeRate.g.cs

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,96 @@ public static ForceChangeRate FromNewtonsPerSecond(double newtonspersecond)
176176
}
177177

178178

179+
/// <summary>
180+
/// Get nullable ForceChangeRate from nullable CentinewtonsPerSecond.
181+
/// </summary>
182+
public static ForceChangeRate? FromCentinewtonsPerSecond(double? centinewtonspersecond)
183+
{
184+
if (centinewtonspersecond.HasValue)
185+
{
186+
return FromCentinewtonsPerSecond(centinewtonspersecond.Value);
187+
}
188+
else
189+
{
190+
return null;
191+
}
192+
}
193+
194+
/// <summary>
195+
/// Get nullable ForceChangeRate from nullable DecinewtonsPerSecond.
196+
/// </summary>
197+
public static ForceChangeRate? FromDecinewtonsPerSecond(double? decinewtonspersecond)
198+
{
199+
if (decinewtonspersecond.HasValue)
200+
{
201+
return FromDecinewtonsPerSecond(decinewtonspersecond.Value);
202+
}
203+
else
204+
{
205+
return null;
206+
}
207+
}
208+
209+
/// <summary>
210+
/// Get nullable ForceChangeRate from nullable KilonewtonsPerSecond.
211+
/// </summary>
212+
public static ForceChangeRate? FromKilonewtonsPerSecond(double? kilonewtonspersecond)
213+
{
214+
if (kilonewtonspersecond.HasValue)
215+
{
216+
return FromKilonewtonsPerSecond(kilonewtonspersecond.Value);
217+
}
218+
else
219+
{
220+
return null;
221+
}
222+
}
223+
224+
/// <summary>
225+
/// Get nullable ForceChangeRate from nullable MicronewtonsPerSecond.
226+
/// </summary>
227+
public static ForceChangeRate? FromMicronewtonsPerSecond(double? micronewtonspersecond)
228+
{
229+
if (micronewtonspersecond.HasValue)
230+
{
231+
return FromMicronewtonsPerSecond(micronewtonspersecond.Value);
232+
}
233+
else
234+
{
235+
return null;
236+
}
237+
}
238+
239+
/// <summary>
240+
/// Get nullable ForceChangeRate from nullable MillinewtonsPerSecond.
241+
/// </summary>
242+
public static ForceChangeRate? FromMillinewtonsPerSecond(double? millinewtonspersecond)
243+
{
244+
if (millinewtonspersecond.HasValue)
245+
{
246+
return FromMillinewtonsPerSecond(millinewtonspersecond.Value);
247+
}
248+
else
249+
{
250+
return null;
251+
}
252+
}
253+
254+
/// <summary>
255+
/// Get nullable ForceChangeRate from nullable NanonewtonsPerSecond.
256+
/// </summary>
257+
public static ForceChangeRate? FromNanonewtonsPerSecond(double? nanonewtonspersecond)
258+
{
259+
if (nanonewtonspersecond.HasValue)
260+
{
261+
return FromNanonewtonsPerSecond(nanonewtonspersecond.Value);
262+
}
263+
else
264+
{
265+
return null;
266+
}
267+
}
268+
179269
/// <summary>
180270
/// Get nullable ForceChangeRate from nullable NewtonsPerSecond.
181271
/// </summary>
@@ -236,6 +326,18 @@ public static ForceChangeRate From(double value, ForceChangeRateUnit fromUnit)
236326
}
237327
switch (fromUnit)
238328
{
329+
case ForceChangeRateUnit.CentinewtonPerSecond:
330+
return FromCentinewtonsPerSecond(value.Value);
331+
case ForceChangeRateUnit.DecinewtonPerSecond:
332+
return FromDecinewtonsPerSecond(value.Value);
333+
case ForceChangeRateUnit.KilonewtonPerSecond:
334+
return FromKilonewtonsPerSecond(value.Value);
335+
case ForceChangeRateUnit.MicronewtonPerSecond:
336+
return FromMicronewtonsPerSecond(value.Value);
337+
case ForceChangeRateUnit.MillinewtonPerSecond:
338+
return FromMillinewtonsPerSecond(value.Value);
339+
case ForceChangeRateUnit.NanonewtonPerSecond:
340+
return FromNanonewtonsPerSecond(value.Value);
239341
case ForceChangeRateUnit.NewtonPerSecond:
240342
return FromNewtonsPerSecond(value.Value);
241343

0 commit comments

Comments
 (0)