Ejemplo 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);
        }
Ejemplo 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
         }
     });
 }
Ejemplo 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;
        }
Ejemplo 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
             }
         };
 }