예제 #1
0
        private static T MapTo <T>(this JobAdEntity entity)
            where T : JobAdEntry, new()
        {
            var t = new T
            {
                Id              = entity.id,
                PosterId        = entity.jobPosterId,
                CreatedTime     = entity.createdTime,
                LastUpdatedTime = entity.lastUpdatedTime,
                ExpiryTime      = entity.expiryTime,
                Title           = entity.title,
                Status          = (JobAdStatus)entity.status,
                FeatureBoost    = (JobAdFeatureBoost)entity.isFeatured,
                Features        = (JobAdFeatures)entity.features,
                ContactDetails  = ((IHaveContactDetailsEntity <ContactDetailsEntity>)entity).Map(),
                LogoId          = entity.brandingLogoImageId,
                Visibility      =
                {
                    HideContactDetails = entity.hideContactDetails,
                    HideCompany        = entity.hideCompany,
                },
            };

            ((IHaveIntegrationEntity)entity).MapTo(t.Integration);
            return(t);
        }
예제 #2
0
        public static JobAd Map(this JobAdEntity entity, ILocationQuery locationQuery, IIndustriesQuery industriesQuery)
        {
            var jobAd = entity.MapTo <JobAd>();

            entity.MapTo(jobAd.Description, locationQuery, industriesQuery);
            return(jobAd);
        }
예제 #3
0
        public static JobAdEntity Map(this JobAd jobAd)
        {
            var entity = new JobAdEntity
            {
                id          = jobAd.Id,
                jobPosterId = jobAd.PosterId,
                createdTime = jobAd.CreatedTime,
                status      = (byte)jobAd.Status,
            };

            jobAd.MapTo(entity);
            return(entity);
        }
예제 #4
0
        public static void MapTo(this JobAdEntry jobAd, JobAdEntity entity)
        {
            entity.expiryTime          = jobAd.ExpiryTime;
            entity.lastUpdatedTime     = jobAd.LastUpdatedTime;
            entity.title               = jobAd.Title;
            entity.isFeatured          = (byte)jobAd.FeatureBoost;
            entity.features            = (int)jobAd.Features;
            entity.brandingLogoImageId = jobAd.LogoId;
            entity.hideContactDetails  = jobAd.Visibility.HideContactDetails;
            entity.hideCompany         = jobAd.Visibility.HideCompany;

            ((IHaveContactDetails)jobAd).MapTo(entity);
            jobAd.MapTo((IHaveIntegrationEntity)entity);
        }
예제 #5
0
 public static void MapTo(this JobAd jobAd, JobAdEntity entity)
 {
     ((JobAdEntry)jobAd).MapTo(entity);
     jobAd.MapTo((IHaveDescriptionEntity)entity);
 }
예제 #6
0
 public static JobAdEntry Map(this JobAdEntity entity)
 {
     return(entity.MapTo <JobAdEntry>());
 }