public async Task <WindowSettingsDto> UpdateWindowSettingsAsync(WindowSettingsDto model) { var windowSettings = await _windowSettingsRepository.GetItemByIdAsync(model.Id); if (windowSettings == null) { throw new EliseException(400, "Doesn't exist in system."); } var windowSettingsEntity = await _windowSettingsRepository.UpdateAsync(model.ToCommand()); return(windowSettingsEntity.ToQueries()); }
public static Entities.Settings.WindowSettings ToCommand(this WindowSettingsDto model) { return(new Entities.Settings.WindowSettings() { Name = model.Name, RoundingType = RoundingType.Double.ToString(), Digits = model.Digits, Value = model.Value, Minimum = model.Minimum, Maximum = model.Maximum }); }
public async Task <WindowSettingsDto> CreateWindowSettingsAsync(WindowSettingsDto model) { var windowSettingsEntity = await _windowSettingsRepository.AddAsync(model.ToCommand()); return(windowSettingsEntity.ToQueries()); }