/// <summary> /// Converts this instance of <see cref="NotificationDto"/> to an instance of <see cref="Notification"/>. /// </summary> /// <param name="dto"><see cref="NotificationDto"/> to convert.</param> public static Notification ToEntity(this NotificationDto dto) { if (dto == null) return null; var entity = new Notification(); entity.NotificationId = dto.NotificationId; entity.NotificationTitle = dto.NotificationTitle; entity.NotificationMessage = dto.NotificationMessage; entity.SentDateTime = dto.SentDateTime; entity.Priority = dto.Priority; entity.Sticky = dto.Sticky; dto.OnEntity(entity); return entity; }
/// <summary> /// Invoked when <see cref="ToEntity"/> operation is about to return. /// </summary> /// <param name="dto"><see cref="NotificationDto"/> converted from <see cref="Notification"/>.</param> /// <param name="entity"><see cref="Notification"/> converted from <see cref="NotificationDto"/>.</param> partial static void OnEntity(this NotificationDto dto, Notification entity);