Esempio n. 1
0
 private VmConnectionsOutput GetRelations(VmConnectionsInput model)
 {
     return(ContextManager.ExecuteReader(unitOfWork =>
     {
         return GetRelations(unitOfWork, model);
     }));
 }
Esempio n. 2
0
 public VmConnectionsOutput SaveRelations(VmConnectionsInput model)
 {
     ContextManager.ExecuteWriter(unitOfWork =>
     {
         SaveRelations(unitOfWork, model);
         unitOfWork.Save();
     });
     return(GetRelations(model));
 }
Esempio n. 3
0
        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);
            }
        }
Esempio n. 4
0
 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 }
     }));
 }
Esempio n. 6
0
        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);
        }