/// <inheritdoc /> public GatheringTool Convert(ItemDataContract value, object state) { if (value == null) { throw new ArgumentNullException("value", "Precondition: value != null"); } GatheringTool gatheringTool; var gatheringToolDataContract = value.GatheringTool; IConverter <GatheringToolDataContract, GatheringTool> converter; if (this.typeConverters.TryGetValue(gatheringToolDataContract.Type, out converter)) { gatheringTool = converter.Convert(gatheringToolDataContract, state); } else { gatheringTool = new UnknownGatheringTool(); } int defaultSkinId; if (int.TryParse(value.DefaultSkin, out defaultSkinId)) { gatheringTool.DefaultSkinId = defaultSkinId; } return(gatheringTool); }
/// <inheritdoc /> public GatheringTool Convert(ItemDTO value, object state) { var entity = new UnknownGatheringTool(); this.Merge(entity, value, state); return(entity); }
// Implement this method in a buddy class to set properties that are specific to 'UnknownGatheringTool' (if any) partial void Merge(UnknownGatheringTool entity, ItemDTO dto, object state);