/// <summary> /// Maps an domain side dependent model to a read side one. /// </summary> /// <param name="value">read side instance</param> /// <param name="existing">existing version to map to</param> /// <returns>read side model</returns> public static DependentDetail ToDependentDetail(this DependentModel value, DependentDetail existing = null) { existing = existing ?? new DependentDetail(); existing.Id = value.Id; existing.EmployeeId = value.EmployeeId; existing.Name = value.Name; return existing; }
public static DependentViewModel FromQueryModel(DependentDetail data) { if (data == null) return null; return new DependentViewModel() { Id = data.Id, EmployeeId = data.EmployeeId, EmployeeVersion = data.EmployeeDetail.Version, Name = data.Name }; }