public static T MapTo <T>(this LocationReference location) where T : ILocationReferenceEntity, new() { var t = new T { id = location.Id }; location.MapTo(t); return(t); }
private static EntitySet <JobAdLocationEntity> Map(this LocationReference locationReference, Guid jobAdId) { if (locationReference == null) { return(null); } // Even though it is a collection in the database only one location per ad is supported. return(new EntitySet <JobAdLocationEntity> { new JobAdLocationEntity { jobAdId = jobAdId, LocationReferenceEntity = locationReference.MapTo <LocationReferenceEntity>() } }); }