public static class DbContextExtensions { public enum ConfiguredCommand{SalesReport} public static void SetConfiguredCommandTimeout(this MyDbContext db, ConfiguredCommand cmd) { var appSetting = "CommandTimeout." + cmd.ToString(); var s = ConfigurationManager.AppSettings[appSetting]; int n; if (int.TryParse(s, out n)) db.Database.CommandTimeout = n; } }
ScrewTurn Wiki version 3.0.1.400. Some of the icons created by FamFamFam. Except where noted, all contents Copyright © 1999-2024, Patrick Jasinski.