Cleanup and fixes

This commit is contained in:
2013-01-12 14:58:33 -05:00
parent bc019923d2
commit e50052d41e
27 changed files with 240 additions and 156 deletions
@@ -0,0 +1,38 @@
using System.Web.Mvc;
using System.Linq;
using AutoMapper;
namespace MileageTraker.Web.ViewModels.User
{
public class ExportUserViewModel
{
public string FullName { get; set; }
public string Username { get; set; }
public string Email { get; set; }
public string Roles { get; set; }
public bool IsLockedOut { get; set; }
public bool IsApproved { get; set; }
public string LastActivityDate { get; set; }
public string LastLoginDate { get; set; }
public string LastPasswordChangedDate { get; set; }
static ExportUserViewModel()
{
Mapper.CreateMap<Models.User, ExportUserViewModel>()
.ForMember(u => u.Roles,
opt => opt.MapFrom(u =>
string.Join((", "), u.Roles.Select(r => r.RoleName))));
}
public ExportUserViewModel(Models.User user)
{
Mapper.Map(user, this);
}
}
}