public async Task <FirmwareUpgrade> CreateFirmwareUpgrade(FirmwareUpgrade upgrade) { try { db.Entry(upgrade).State = EntityState.Added; await db.SaveChangesAsync(); } catch (Exception e) { Trace.TraceError("Error saving logging device: {0}", e); return(null); } return(upgrade); }
public async Task <LoggingDevice> RegisterLoggingDevice(string deviceId, string deviceName) { LoggingDevice newDevice = new LoggingDevice { DeviceName = deviceId, FriendlyName = deviceName }; try { db.Entry(newDevice).State = EntityState.Added; await db.SaveChangesAsync(); } catch (Exception e) { Trace.TraceError("Error saving logging device: {0}", e); return(null); } return(newDevice); }
public Task UpdateAsync(WebUser user) { db.Entry(user).State = EntityState.Modified; return(db.SaveChangesAsync()); }