public ActionResult RegisterNewChild(Guid childId, string childName, int childAge, string countryName, string programType, string otherDetailsOnlyThisServiceCaresAbout, string childPhotoLink)
{
using (var session = MvcApplication.DocumentStore.OpenSession())
{
session.Store(new Child
{
ChildId = childId,
ChildName = childName,
ChildAge = childAge,
CountryName = countryName,
ProgramType = programType,
OtherDetailsOnlyThisServiceCaresAbout = otherDetailsOnlyThisServiceCaresAbout,
ChildPhotoLink = new Uri(childPhotoLink)
});
session.SaveChanges();
}
MvcApplication.Bus.Send<IChildRegisteredInProgram>(m =>
{
m.ChildId = childId;
m.ChildName = childName;
m.ChildAge = childAge;
m.CountryName = countryName;
m.ProgramType = programType;
m.OtherChildDetailsThatOurServiceIsNotInterestedIn = otherDetailsOnlyThisServiceCaresAbout;
m.ChildPhotoLink = new Uri(childPhotoLink);
});
return RedirectToAction("Index", "ChildRegistration");
}