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); }
public static JobAd Map(this JobAdEntity entity, ILocationQuery locationQuery, IIndustriesQuery industriesQuery) { var jobAd = entity.MapTo <JobAd>(); entity.MapTo(jobAd.Description, locationQuery, industriesQuery); return(jobAd); }
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); }
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); }
public static void MapTo(this JobAd jobAd, JobAdEntity entity) { ((JobAdEntry)jobAd).MapTo(entity); jobAd.MapTo((IHaveDescriptionEntity)entity); }
public static JobAdEntry Map(this JobAdEntity entity) { return(entity.MapTo <JobAdEntry>()); }