public static Reservation ToModel(this ReservationViewModel vm, UserProfile profile) { return new Reservation() { Id = vm.Id, ActivityPackageId = vm.ActivityPackage.Id, UserId = vm.User.Id, Message = vm.Message, AuditInfo = new AuditInfo(profile.ApplicationUser.Id), }; }
public static IEnumerable<Reservation> ToModel(this IEnumerable<ReservationViewModel> reserations, UserProfile profile) { return (from r in reserations select r.ToModel(profile)).ToList(); }