To add more parameters in the url, you could separate parameters on the url
using the &
char, for sample:
http://localhost:14834/Appointment/Create?appointmentId=e2fd8b29-2769-406a-b03d-203f9675edde&attendeeId=e2fd8b29-2769-406a-b03d-203f9675edde
And asp.net mvc will bind it for you on the Guid
objects of your action.
A sample of code:
public static string CreateUrl(Guid appointmentId, Guid attendeeId)
{
return string.Format("http://yourdomain.com/Response/AttendeeResponse?appointmentId={0}&attendeeId={1}", appointmentId.ToString(), attendeeId.ToString());
}
And since you have the guids objects, you could just use this method, for sample:
string url = CreateUrl(appointmentGuid, attendeeguid);
Another solution
Anyway, do you have any place to store the appointments right? I mean, a table in a database for sample.
Maybe you could do these steps:
- you could generate a Guid for
appointmentId
and another Guid forattendeeId
. - Store it on database for future access.
- Send the the url with the
appointmentId
to user's email. - When the user click on the URL, on your action you could read from database what is the
attendeeId
for the respectiveappointmentId
.