コード例 #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();
            }
        }
コード例 #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();
            }
        }
コード例 #3
0
ファイル: IProfileService.cs プロジェクト: wijayakoon/Unixmo
 public void CreateUser(UserProfile userProfile)
 {
     _profileRepository.CreateUser(userProfile);
 }