private void MapTo(EnterspeedJobSchema source, EnterspeedJob target, MapperContext context)
 {
     target.Id        = source.Id;
     target.ContentId = source.ContentId;
     target.CreatedAt = source.CreatedAt;
     target.UpdatedAt = source.UpdatedAt;
     target.JobType   = (EnterspeedJobType)source.JobType;
     target.State     = (EnterspeedJobState)source.JobState;
     target.Exception = source.Exception;
     target.Culture   = source.Culture;
 }
 private void MapFrom(EnterspeedJob source, EnterspeedJobSchema target, MapperContext context)
 {
     target.Id        = source.Id;
     target.ContentId = source.ContentId;
     target.CreatedAt = source.CreatedAt;
     target.UpdatedAt = source.UpdatedAt;
     target.JobType   = source.JobType.GetHashCode();
     target.JobState  = source.State.GetHashCode();
     target.Exception = source.Exception;
     target.Culture   = source.Culture;
 }
 private EnterspeedJob GetFailedJob(EnterspeedJob handledJob, string exception)
 {
     return(new EnterspeedJob
     {
         ContentId = handledJob.ContentId,
         Culture = handledJob.Culture,
         CreatedAt = handledJob.CreatedAt,
         UpdatedAt = DateTime.UtcNow,
         JobType = handledJob.JobType,
         State = EnterspeedJobState.Failed,
         Exception = exception
     });
 }
        private EnterspeedJobSchema MapToSchema(EnterspeedJob job)
        {
            if (job == null)
            {
                return(null);
            }

            return(new EnterspeedJobSchema
            {
                Id = job.Id,
                ContentId = job.ContentId,
                CreatedAt = job.CreatedAt,
                Culture = job.Culture,
                Exception = job.Exception,
                JobType = job.JobType.GetHashCode(),
                JobState = job.State.GetHashCode(),
                UpdatedAt = job.UpdatedAt
            });
        }