public override void AssignFrom(PartakerEntity entity) { base.AssignFrom(entity); this.Task = entity.Task.ToViewModel(); this.Staff = entity.Staff.ToViewModel(); }
public static StaffViewModel ToViewModel(this StaffEntity entity) { if (entity == null) throw new ArgumentNullException(nameof(entity)); var result = new StaffViewModel(); result.AssignFrom(entity); return result; }
public virtual void AssignFrom(VotingEntity entity) { if (entity == null) throw new ArgumentNullException(nameof(entity)); this.Id = entity.Id; this.Reason = entity.Reason; this.VoteOptionId = entity.Option.Id; this.Staff = entity.Staff.ToViewModel(); this.CreatedAt = entity.CreatedAt; }