Esempio n. 1
0
        public void ServiceTest()
        {
            var settings = new CopierSettings();

            settings.BaseTypesToRemove.Add(typeof(BaseServiceInstance <,>));
            var c = new Copier(settings);

            c.LimitOutputToAssemblyOfType(typeof(TokenRequest));
            c.AddType(typeof(TokenRequest));
            var r = c.Process();

            Console.WriteLine(r);
        }
Esempio n. 2
0
        public void ServiceTestWithReplacementType()
        {
            var settings = new CopierSettings
            {
                ReplacementTypes =
                {
                    { typeof(TokenDate),   typeof(DateTime) },
                    { typeof(TokenString), typeof(string)   },
                }
            };

            settings.BaseTypesToRemove.Add(typeof(BaseServiceInstance <,>));
            var c = new Copier(settings);

            c.LimitOutputToAssemblyOfType(typeof(TokenRequest));
            c.AddType(typeof(TokenRequest));
            var r = c.Process();

            Console.WriteLine(r);
        }
Esempio n. 3
0
        public string ModelDuplicator()
        {
            (string, string)replaceWith = ($"Gtt.Links.Core", $"Gtt.Links.Client");
            var settings = new CopierSettings();

            settings.BaseTypesToRemove.Add(typeof(BaseServiceInstance <,>));
            settings.BaseTypesToRemove.Add(typeof(BaseStatefulServiceInstance <, , , ,>));
            var mt = new Copier(settings)
            {
                AlwaysGetAndSet  = true,
                ReplaceNamespace = replaceWith
            };

            mt.LimitOutputToAssemblyOfType(typeof(HealthCheckRequest));

            foreach (var instance in _instances)
            {
                mt.AddType(instance.RequestType);
                mt.AddType(instance.ResponseType);
            }

            return(mt.Process());
        }