Esempio n. 1
0
        /// <summary>
        /// Creates <see cref="IRickAndMortyService"/> interface instance.
        /// </summary>
        /// <returns></returns>
        public static IRickAndMortyService Create()
        {
            var mapper = MapperModule.Resolve();

            var service = new RickAndMortyService(mapper);

            return(service);
        }
Esempio n. 2
0
        protected override void Load(ContainerBuilder builder)
        {
            builder.RegisterType <RickAndMortyService>()
            .AsImplementedInterfaces()
            .SingleInstance();

            builder.Register(ctx => MapperModule.Resolve())
            .As <IRickAndMortyMapper>()
            .SingleInstance();
        }
Esempio n. 3
0
        /// <summary>
        /// Creates <see cref="IRickAndMortyService"/> interface instance.
        /// </summary>
        /// <param name="url">URL to service.</param>
        /// <returns></returns>
        public static IRickAndMortyService Create(string url)
        {
            Ensure.Bool.IsFalse(String.IsNullOrEmpty(url));

            var mapper = MapperModule.Resolve();

            var service = new RickAndMortyService(mapper, url);

            return(service);
        }