public async Task <FullDatagram> AddAsync(FullDatagram datagram) { if (datagram == null) { throw new ArgumentNullException("datagram was null"); } else { try { await _meterContext.AddAsync(datagram); await _meterContext.SaveChangesAsync(); return(datagram); } catch (Exception e) { throw new Exception(e.Message); } } }
public async Task <TempratureModel> addAsync(TempratureModel temprature) { if (temprature == null) { throw new ArgumentNullException("temprature was null"); } else { try { await _meterContext.AddAsync(temprature); await _meterContext.SaveChangesAsync(); return(temprature); } catch (Exception e) { throw new Exception(e.Message); } } }