Ejemplo n.º 1
0
        public static IRegistry LoadRegistry(Stream stream)
        {
            var dto        = RegistryDto.LoadFromStream(stream);
            var messageIds =
                from svcDto in dto.Services
                from metDto in svcDto.Methods
                from mid in new[] { metDto.RequestMessageId, metDto.ResponseMessageId }
            select mid;
            var    messages = messageIds.Distinct().ToDictionary(x => x, x => (IMessage) new Message {
                Id = x
            });
            var services     = dto.Services.Select(x => Convert(messages, x)).ToDictionary(x => x.Id, x => x);
            var applications = dto.Applications.Select(x => Convert(services, x)).ToDictionary(x => x.Id, x => x);

            return(new Registry
            {
                Messages = messages,
                Services = services,
                Applications = applications
            });
        }
Ejemplo n.º 2
0
 public static IRegistry LoadRegistry(Stream stream)
 {
     return(LoadRegistry(RegistryDto.LoadFromStream(stream)));
 }