public async Task Remove(Domain.Messages.Job job)
        {
            var entity = await DataContext.Jobs.SingleOrDefaultAsync(j => j.Id == job.Id);

            if (entity != null)
            {
                DataContext.Remove(entity);
            }
        }
        Job AddEntity(Domain.Messages.Job job)
        {
            var entity = new Job
            {
                Id = job.Id
            };

            DataContext.Add(entity);
            return(entity);
        }
Exemple #3
0
        public void SetValuesFrom(Domain.Messages.Job job)
        {
            Id = job.Id;

            Address   = job.Address;
            Handler   = job.Handler;
            MessageId = job.MessageId;
            QueueId   = job.QueueId;

            Created = job.Created;
        }
        public async Task Save(Domain.Messages.Job job)
        {
            var entity = await DataContext.Jobs.SingleOrDefaultAsync(j => j.Id == job.Id) ?? AddEntity(job);

            entity.SetValuesFrom(job);
        }