Skip to content

Instantly share code, notes, and snippets.

@chandu
Created April 4, 2014 03:41
Show Gist options
  • Select an option

  • Save chandu/9967659 to your computer and use it in GitHub Desktop.

Select an option

Save chandu/9967659 to your computer and use it in GitHub Desktop.
public class LoginViewModel
{
public string UserName { get; set; }
public string Password { get; set; }
public bool RememberMe { get; set; }
//TODO: (CV) These should go to ViewBag later
public IDictionary<string, IEnumerable<string>> Errors { get; set; }
public IEnumerable<string> FlattenedErrors
{
get { return (Errors != null)? Errors.SelectMany(a => a.Value):Enumerable.Empty<string>(); }
}
public bool HasErrors
{
get { return FlattenedErrors.Any(); }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment