private VmConnectionsOutput GetRelations(VmConnectionsInput model) { return(ContextManager.ExecuteReader(unitOfWork => { return GetRelations(unitOfWork, model); })); }
public VmConnectionsOutput SaveRelations(VmConnectionsInput model) { ContextManager.ExecuteWriter(unitOfWork => { SaveRelations(unitOfWork, model); unitOfWork.Save(); }); return(GetRelations(model)); }
private void SaveRelations(IUnitOfWorkWritable unitOfWork, VmConnectionsInput model) { var unificRootId = versioningManager.GetUnificRootId <ServiceVersioned>(unitOfWork, model.Id); if (unificRootId.HasValue) { model.UnificRootId = unificRootId.Value; TranslationManagerToEntity.Translate <VmConnectionsInput, Service>(model, unitOfWork); } }
public IServiceResultWrap SaveRelations([FromBody] VmConnectionsInput model) { return serviceManager.CallService( () => new ServiceResultWrap() { Data = channelService.SaveRelations(model) }, new Dictionary<Type, string>() { { typeof(string), MessageAddServiceAndChannel } }); }
public IServiceResultWrap SaveRelations([FromBody] VmConnectionsInput model) { return(serviceManager.CallService( () => new ServiceResultWrap() { Data = generalDescriptionService.SaveRelations(model) }, new Dictionary <Type, string>() { { typeof(string), MessageSaveGeneralDescription } })); }
private VmConnectionsOutput GetRelations(IUnitOfWork unitOfWork, VmConnectionsInput model) { var serviceRep = unitOfWork.CreateRepository <IServiceRepository>(); var unificRootId = versioningManager.GetUnificRootId <ServiceVersioned>(unitOfWork, model.Id); if (unificRootId.HasValue) { var service = serviceRep.All() .Include(j => j.ServiceServiceChannels).ThenInclude(j => j.ServiceChannel).ThenInclude(j => j.Versions).ThenInclude(j => j.ServiceChannelNames) .Include(j => j.ServiceServiceChannels).ThenInclude(j => j.ServiceChannel).ThenInclude(j => j.Versions).ThenInclude(j => j.LanguageAvailabilities) .Include(j => j.ServiceServiceChannels).ThenInclude(j => j.ServiceServiceChannelDescriptions) .Include(j => j.ServiceServiceChannels).ThenInclude(j => j.ServiceServiceChannelDigitalAuthorizations).ThenInclude(j => j.DigitalAuthorization) .Single(x => x.Id == unificRootId.Value); var result = TranslationManagerToVm.Translate <Service, VmConnectionsOutput>(service); result.Id = model.Id; return(result); } return(null); }