Add details to emails

A few clarifications
This commit is contained in:
2013-01-15 15:28:17 -05:00
parent 184b8a4166
commit b19b44305a
7 changed files with 59 additions and 10 deletions
+8 -2
View File
@@ -1,6 +1,7 @@
using System.Web.Mvc;
using System;
using System.Linq;
using AutoMapper;
using MileageTraker.Web.Utility;
namespace MileageTraker.Web.ViewModels.User
{
@@ -24,12 +25,17 @@ namespace MileageTraker.Web.ViewModels.User
static ExportUserViewModel()
{
Mapper.CreateMap<DateTime, string>()
.ConvertUsing(dt =>
dt.IsSqlMinValue()
? string.Empty
: dt.Date.ToString("d"));
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);