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

            profile.MapTo(entity);
            return(entity);
        }
示例#2
0
        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();
            }
        }