Entity Framework 6 – Get edmx connection string

/// <summary> /// Extensions for Entity Framework DbContext /// </summary> public static class DbContextExtensions { /// <summary> /// Gets the edmx connection string from an active DbContext. /// </summary> /// <param name=”context”>The context.</param> /// <returns></returns> public static string GetEdmxConnectionString(this DbContext…Continue Reading →

Mvc Helpers – HtmlAttributes Extension

Just a quick not on how to pass and render HtmlAttributes in a helper: public HtmlString Add(YourObject yourObject, object htmlAttributes = null) { var attributes = HtmlHelper.AnonymousObjectToHtmlAttributes(htmlAttributes); //process you markup etc. attributes.ToHtmlAttributes() } public static class RouteValueDictionaryExtensions { public static…Continue Reading →