Exemplo n.º 1
0
        public void CreateUser(UserProfile userProfile)
        {
            using (var context = DbContextFactory.Create())
            {
                var registration = Mapper.Map<UserProfile, Registration>(userProfile);

                context.Registrations.Add(registration);
                context.SaveChanges();
            }
        }
Exemplo n.º 2
0
        public void UpdateUser(UserProfile userProfile)
        {
            using (var context = DbContextFactory.Create())
            {
                // Fetch the existing registration record
                var registration = context.Registrations.Single(r => r.EmailAddress.Equals(userProfile.Email, StringComparison.OrdinalIgnoreCase));

                // Map the new details
                Mapper.Map(userProfile, registration);

                // Save to database
                context.SaveChanges();
            }
        }
Exemplo n.º 3
0
 public void CreateUser(UserProfile userProfile)
 {
     _profileRepository.CreateUser(userProfile);
 }