public override VmPrintableFormOutput TranslateEntityToVm(ServiceChannelVersioned entity)
        {
            var definition = CreateEntityViewModelDefinition(entity)
                             .AddNavigation(i => i.PrintableFormChannels.FirstOrDefault()?.DeliveryAddress, o => o.DeliveryAddress)
                             .AddDictionary(
                input => input.PrintableFormChannels.FirstOrDefault()?.FormIdentifiers.Select(x => x),
                output => output.FormIdentifier,
                k => languageCache.GetByValue(k.LocalizationId)
                )
                             .AddDictionary(
                input => input.PrintableFormChannels.FirstOrDefault()?.FormReceivers.Select(x => x),
                output => output.FormReceiver,
                k => languageCache.GetByValue(k.LocalizationId)
                )
                             .AddDictionaryList(
                input => input.PrintableFormChannels.FirstOrDefault()?.ChannelUrls,
                output => output.FormFiles,
                k => languageCache.GetByValue(k.LocalizationId)
                );

            definitionHelper
            .AddAttachmentsDefinition(definition, entity)
            .AddChannelBaseDefinition(definition);
            return(definition.GetFinal());
        }
        public override ServiceChannelVersioned TranslateVmToEntity(VmPrintableFormInput vm)
        {
            var definition = CreateViewModelEntityDefinition(vm)
                             .DisableAutoTranslation()
                             .UseDataContextCreate(i => !i.Id.IsAssigned(), o => o.Id, i => Guid.NewGuid())
                             .UseDataContextLocalizedUpdate(i => i.Id.IsAssigned(), i => o => i.Id == o.Id)
                             .UseVersioning <ServiceChannelVersioned, ServiceChannel>(o => o)
                             .AddLanguageAvailability(i => i, o => o)
                             .AddSimple(i => typesCache.Get <ServiceChannelType>(ServiceChannelTypeEnum.PrintableForm.ToString()), o => o.TypeId)
                             .AddNavigationOneMany(i => i, o => o.PrintableFormChannels);

            definitionHelper
            .AddAttachmentsDefinition(definition, vm, vm.Id)
            .AddChannelBaseDefinition(definition);
            return(definition.GetFinal());
        }