public static IncentiveKindViewModel ToViewModel(this IncentiveKindEntity entity) { if (entity == null) throw new ArgumentNullException(nameof(entity)); var result = new IncentiveKindViewModel(); result.AssignFrom(entity); return result; }
public virtual void AssignFrom(TaskIncentiveEntity entity) { if (entity == null) throw new ArgumentNullException(nameof(entity)); this.Amount = entity.Amount; this.IncentiveKind = entity.IncentiveKind.ToViewModel(); }