private EventOveralViewModel PrepareEventOveralViewModel(Event e) { EventOveralViewModel result = Mapper.Map <EventOveralViewModel>(e); result.StartDateString = result.StartDate.ToString("dd/MM/yyyy"); result.EndDateString = result.EndDate.ToString("dd/MM/yyyy"); result.PlaceName = e.Place.Name; return(result); }
private EventOveralViewModel PrepareEventForMember(Event e, string currentUserId) { EventOveralViewModel result = Mapper.Map <EventOveralViewModel>(e); result.StartDateString = result.StartDate.ToString("dd/MM/yyyy"); result.EndDateString = result.EndDate.ToString("dd/MM/yyyy"); result.PlaceName = e.Place.Name; result.Joined = false; List <Participation> list = e.Participations.ToList(); foreach (var l in list) { if (l.UserId.Equals(currentUserId)) { result.Joined = true; } } return(result); }