/// <summary>Initializes a new instance of the <see cref="SwaggerToCSharpGenerator"/> class.</summary>
        /// <param name="service">The service.</param>
        /// <exception cref="ArgumentNullException"><paramref name="service"/> is <see langword="null" />.</exception>
        public SwaggerToCSharpGenerator(SwaggerService service)
        {
            if (service == null)
                throw new ArgumentNullException("service");

            _service = service;

            foreach (var definition in _service.Definitions)
                definition.Value.TypeName = definition.Key;

            _resolver = new SwaggerToCSharpTypeResolver(_service.Definitions);
        }
Esempio n. 2
0
        /// <summary>Initializes a new instance of the <see cref="SwaggerToCSharpGenerator"/> class.</summary>
        /// <param name="service">The service.</param>
        /// <exception cref="ArgumentNullException"><paramref name="service"/> is <see langword="null" />.</exception>
        public SwaggerToCSharpGenerator(SwaggerService service)
        {
            if (service == null)
            {
                throw new ArgumentNullException("service");
            }

            _service = service;

            foreach (var definition in _service.Definitions)
            {
                definition.Value.TypeName = definition.Key;
            }

            _resolver = new SwaggerToCSharpTypeResolver(_service.Definitions);
        }