/// <inheritdoc /> public Consumable Convert(ItemDTO value, object state) { var entity = new ImmediateConsumable(); this.Merge(entity, value, state); return(entity); }
partial void Merge(ImmediateConsumable entity, ItemDTO dto, object state) { var consumableDto = dto.Consumable; if (consumableDto == null) { return; } entity.Effect = consumableDto.Description; double duration; if (double.TryParse(consumableDto.Duration, out duration)) { entity.Duration = TimeSpan.FromMilliseconds(duration); } }
partial void Merge(ImmediateConsumable entity, ItemDTO dto, object state) { var details = dto.Details; if (details == null) { return; } var duration = details.Duration; if (duration.HasValue) { entity.Duration = TimeSpan.FromMilliseconds(duration.Value); } entity.Effect = details.Description; }
// Implement this method in a buddy class to set properties that are specific to 'ImmediateConsumable' (if any) partial void Merge(ImmediateConsumable entity, ItemDTO dto, object state);