public async void Update(StatusDto statusDto)
        {
            var entity = await _dbContext.Statuses
                         .Where(s => s.Id == (int)statusDto.Key)
                         .FirstOrDefaultAsync();

            entity.Value       = statusDto.Value;
            entity.LastChanged = DateTime.Now;

            _dbContext.Statuses.Update(entity);
        }
 public async Task InsertAsync(StatusDto statusDto)
 {
     await _dbContext.Statuses.AddAsync(new StatusModel(statusDto));
 }
Ejemplo n.º 3
0
 public StatusModel(StatusDto statusDto)
 {
     this.Id          = (int)statusDto.Key;
     this.Value       = statusDto.Value;
     this.LastChanged = DateTime.Now;
 }