public async Task <long> CreateAsync(SensorTypeModel model) { if (model.Id > 0) { throw new ArgumentException(nameof(model.Id), "Invalid model."); } return(await repository.AddOrUpdateAsync(model)); }
public async Task UpdateAsync(SensorTypeModel model) { if (model.Id == 0) { throw new ArgumentException(nameof(model.Id)); } await repository.AddOrUpdateAsync(model); }