コード例 #1
0
        public async Task <ActionResult <Attendee> > PostAttendee(Domain.Attendee attendee)
        {
            _context.Attendees.Add(Attendee.FromDomain(attendee));
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetAttendee", new { id = attendee.Id }, attendee));
        }
コード例 #2
0
 public static Attendee FromDomain(Domain.Attendee domain)
 {
     return(new Attendee {
         FirstName = domain.FirstName,
         LastName = domain.LastName,
         EmailAddress = domain.EmailAddress,
         UserName = domain.UserName,
     });
 }