public UpdateRecruitmentStatusModel(RecruitmentStatusCacheModel model) { Id = model.Id; Name = model.Name; Color = model.Color; SortOrder = model.SortOrder; }
public async Task AddOrUpdate(RecruitmentStatusCacheModel model) { try { var recruitmentStatuses = await LoadFromRedis(); var recruitmentStatus = recruitmentStatuses.FirstOrDefault(c => c.Id == model.Id); if (recruitmentStatus == null) { recruitmentStatuses.Add(model); } else { recruitmentStatus.Name = model.Name; recruitmentStatus.Color = model.Color; recruitmentStatus.SortOrder = model.SortOrder; } await DistributedCache.Set(_cacheKey, recruitmentStatuses); } catch (Exception exception) { _logger.Info(exception.ToString); } }
public RecruitmentStatusSimpleModel(RecruitmentStatusCacheModel model) { Id = model.Id; Name = model.Name; }