public static void AddReservation(Member_ mem, Video_ video)
{
// populate the reservation object with data in the member and video
// add to the database
[b]Mapper.CreateMap<Video_,Reservation>().ForMember(m => m.Video_ID,c => c.MapFrom(e => e.ID));[/b]
try
{
using( var a = new videoRentalEntities())
{
Reservation currentReservation = ReservationMapping(mem,video);
a.Reservations.AddObject(currentReservation);
a.SaveChanges();
}
}
catch
{
throw new ArgumentException();
}
}
its kind of tedious to map every single property from the business entity to dataobject, As i have 10 properties. By the way the properties are of different names from eachother, i'm aware of using the mapper.map() method.
So instead of mapping each property indivdual, times 10 is there a more easier way?
thanks,
Ray