public async Task <ActionResult <long> > InsertAttendees(AttendeeRegistrationRequestDto item) { var insertedSequence = await attendeeRepository.InsertAsync(item.AsAttnedee()); if (insertedSequence < 1) { return(StatusCode(StatusCodes.Status406NotAcceptable)); } return(StatusCode(StatusCodes.Status201Created, insertedSequence)); }
public static AttendeeRegistration AsAttnedee(this AttendeeRegistrationRequestDto item) { return(new AttendeeRegistration { Id = Guid.NewGuid(), CreationDateTime = DateTimeOffset.UtcNow, FullName = item.FullName, Gender = item.Gender, PhoneNumber = item.PhoneNumber, Email = item.Email, Lc = item.Lc, Function = item.Function, Role = item.Role, FacebookLink = item.FacebookLink, NeededMedia = item.NeededMedia, SelectedMerch = item.SelectedMerch }); }