Esempio n. 1
0
        /// <summary>
        /// Gets the service info.
        /// </summary>
        /// <param name="serviceIdentification">The service info heartBeatEntity.</param>
        /// <param name="repository">The repository.</param>
        /// <returns></returns>
        private ServiceInfoEntity GetServiceInfo(Identification serviceIdentification, IServiceInfoRepository repository)
        {
            var infoEntity = repository.FindOne(new { Identification = new { serviceIdentification.Id, serviceIdentification.Type } });

            if (infoEntity == null)
            {
                InvokeServiceNotExist(new ServiceInfoEventHandlerArgs());
            }

            return(infoEntity);
        }
Esempio n. 2
0
 /// <summary>
 /// Gets the or create service info.
 /// </summary>
 /// <param name="serviceIdentification">The service identification.</param>
 /// <param name="repository">The repository.</param>
 /// <returns></returns>
 private static ServiceInfoEntity GetOrCreateServiceInfo(Identification serviceIdentification, IServiceInfoRepository repository)
 {
     return(repository.FindOne(new { Identification = new { serviceIdentification.Id, serviceIdentification.Type } }) ??
            new ServiceInfoEntity
     {
         Identification = new Identification
         {
             Id = serviceIdentification.Id,
             Type = serviceIdentification.Type
         }
     });
 }
Esempio n. 3
0
        /// <summary>
        /// Gets the service info.
        /// </summary>
        /// <param name="serviceIdentification">The service info heartBeatEntity.</param>
        /// <param name="repository">The repository.</param>
        /// <returns></returns>
        private ServiceInfoEntity GetServiceInfo(Identification serviceIdentification, IServiceInfoRepository repository)
        {
            var infoEntity = repository.FindOne(new {Identification = new {serviceIdentification.Id, serviceIdentification.Type}});
            if (infoEntity == null)
            {
                InvokeServiceNotExist(new ServiceInfoEventHandlerArgs());
            }

            return infoEntity;
        }
Esempio n. 4
0
 /// <summary>
 /// Gets the or create service info.
 /// </summary>
 /// <param name="serviceIdentification">The service identification.</param>
 /// <param name="repository">The repository.</param>
 /// <returns></returns>
 private static ServiceInfoEntity GetOrCreateServiceInfo(Identification serviceIdentification, IServiceInfoRepository repository)
 {
     return repository.FindOne(new { Identification = new { serviceIdentification.Id, serviceIdentification.Type } }) ??
         new ServiceInfoEntity
         {
             Identification = new Identification
             {
                 Id = serviceIdentification.Id,
                 Type = serviceIdentification.Type
             }
         };
 }