/// <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); }
protected override void Load(ContainerBuilder builder) { builder.RegisterType <RickAndMortyService>() .AsImplementedInterfaces() .SingleInstance(); builder.Register(ctx => MapperModule.Resolve()) .As <IRickAndMortyMapper>() .SingleInstance(); }
/// <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); }