public static Registration ToEntity(this RegistrationModel instance) { if (instance.IsNull()) { return(null); } return(new Registration { Aerials = instance.Aerials, Classes = instance.Classes.ToListIfNotNull(), FirstName = instance.FirstName, Email = instance.Email, PaymentStatus = instance.PaymentStatus, Surname = instance.Surname, AerialsPartner = instance.AerialsPartner, AerialsTeachers = instance.AerialsTeachers, Amount = instance.Amount, Balboa = instance.Balboa, BalboaLevel = instance.BalboaLevel, BalboaPartner = instance.BalboaPartner, BluesLevel = instance.BluesLevel, City = instance.City, CountryOfResidence = instance.CountryOfResidence, Id = instance.Id, DanceRole = instance.DanceRole, EmergencyContactNumber = instance.EmergencyContactNumber, RegistationId = instance.RegistationId, EmergencyContactPerson = instance.EmergencyContactPerson, Events = instance.Events.ToListIfNotNull(), FullPass = instance.FullPass, Hellzapoppin = instance.Hellzapoppin, HellzapoppinPartner = instance.HellzapoppinPartner, JackAndJill = instance.JackAndJill, LindyLevel = instance.LindyLevel, Novice = instance.Novice, NovicePartner = instance.NovicePartner, Over18 = instance.Over18, PerformAtGrammy = instance.PerformAtGrammy, PhoneNumber = instance.PhoneNumber, ShowcaseCouple = instance.ShowcaseCouple, ShowcaseCouplePartner = instance.ShowcaseCouplePartner, ShowcaseTeam = instance.ShowcaseTeam, ShowcaseTeamPartner = instance.ShowcaseTeamPartner, SoloJazz = instance.SoloJazz, StrictlyLindy = instance.StrictlyLindy, StrictlyLindyPartner = instance.StrictlyLindyPartner, TermsAndConditions = instance.TermsAndConditions }); }