This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public ActionResult Auth() | |
{ | |
const string scope = "https://www.google.com/analytics/feeds/"; | |
var next = Url.FullPath("~/home/authresponse"); | |
var url = AuthSubUtil.getRequestUrl(next, scope, false, true); | |
return Redirect(url); | |
} | |
public ActionResult AuthResponse(string token) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class EnumerableExtensions | |
{ | |
public static IEnumerable<SelectListItem> ToSelectListItems<T>(this IEnumerable<T> items, Func<T, string> name, Func<T, string> value, string selectedValue) | |
{ | |
return items.ToSelectListItems(name, value, selectedValue, false); | |
} | |
public static IEnumerable<SelectListItem> ToSelectListItems<T>(this IEnumerable<T> items, Func<T, string> name, Func<T, string> value, string selectedValue, bool includeNotApplicable, string notApplicableValue = "", string notApplicableText = "(Not Applicable)") | |
{ | |
return items.ToSelectListItems(name, value, x => value(x) == selectedValue, includeNotApplicable, notApplicableValue, notApplicableText); |
NewerOlder