Skip to content

Removing the Undefined unit #983

Closed
Closed
@lipchev

Description

@lipchev
  1. Replace with non-nullable value (constructing with BaseUnit by default)
    private readonly MassUnit? _unit;
  2. Remove all the guard checks:
    if(unit == MassUnit.Undefined) throw new ArgumentException("The quantity can not be created with an undefined unit.", nameof(unit));

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions