Beispiel #1
0
        // This method gets called by the runtime. Use this method to add services to the container.
        // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddMvc();
            services.AddAutoMapper();

            services.AddSwaggerGen(setup =>
            {
                setup.SwaggerDoc("v1", new Info
                {
                    Title   = "KinguilaApp API",
                    Version = "v1",
                    Contact = new Contact
                    {
                        Name  = "Henrick Kakutalua",
                        Email = "*****@*****.**",
                        Url   = "https://medium.com/@henrickpedro"
                    }
                });

                var xmlFile = $"{Assembly.GetExecutingAssembly().GetName().Name}.xml";
                setup.IncludeXmlComments(Path.Combine(AppContext.BaseDirectory, xmlFile));
            });

            services.AddTransient <IExchangeRateService, KinguilaHojeExchangeRateService>();
            services.AddTransient <IPageTextualInformationParser, KinguilaHojeTextualInformationParser>();
            services.AddSingleton <KinguilaHojeSourceMapper>();
            services.AddTransient <IDateProvider>(x => DateProvider.Default());
        }
Beispiel #2
0
 public KinguilaHojeTextualInformationParser GetDefaultParser()
 {
     return(new KinguilaHojeTextualInformationParser(DateProvider.Default()));
 }