static void Main(string[] args) { Func <Option <string>, string> greet2 = (Option <string> greetee) => greetee.Match( None: () => "Sorry, who?", Some: (name) => $"Hello, {name}" ); string gg1 = greet2("Jo"); string gg2 = greet2(null); using (PersonalDataContext context = new PersonalDataContext()) { foreach (TypeDigest typeDigest in context.TypeDigests) { Console.WriteLine(typeDigest.Code); } } Console.ReadKey(); }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, PersonalDataContext dataContext) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); app.UseBrowserLink(); } else { app.UseExceptionHandler("/Home/Error"); } DataInitializer.InitializeDatabase(dataContext); app.UseStaticFiles(); app.UseMvc(routes => { routes.MapRoute( name: "default", template: "{controller=Home}/{action=Index}/{id?}"); }); }
public DataRepository(PersonalDataContext dataContext) { _dataContext = dataContext; }