public virtual void ChangeUnitGroup(UnitGroup newGroup) { if (newGroup == null || newGroup == UnitGroup) { return; } _unitGroup = newGroup; newGroup.AddUnit(this); }
public static Unit Create(UnitDto dto, UnitGroup group) { var unit = new Unit { Abbreviation = dto.Abbreviation, IsReference = dto.IsReference, Name = dto.Name, Multiplier = dto.Multiplier }; unit.SetUnitGroup(group); Validate(unit); return(unit); }
public virtual bool CannotChangeGroup(UnitGroup newGroup) { return(Products.UnitGroup.Equals(newGroup, _unitGroup, new UnitGroupComparer())); }
private void SetUnitGroup(UnitGroup group) { ChangeUnitGroup(group); }