コード例 #1
0
        public static EmployerProfileEntity Map(this EmployerProfile profile, Guid employerId)
        {
            var entity = new EmployerProfileEntity {
                employerId = employerId
            };

            profile.MapTo(entity);
            return(entity);
        }
コード例 #2
0
ファイル: ProfilesRepository.cs プロジェクト: formist/LinkMe
        void IProfilesRepository.UpdateEmployerProfile(Guid employerId, EmployerProfile profile)
        {
            using (var dc = CreateContext())
            {
                // Create or update as needed.

                var entity = GetEmployerProfileEntity(dc, employerId);
                if (entity == null)
                {
                    dc.EmployerProfileEntities.InsertOnSubmit(profile.Map(employerId));
                }
                else
                {
                    profile.MapTo(entity);
                }
                dc.SubmitChanges();
            }
        }