public async Task <bool> SaveComponentAsync(UserComponentType type) { try { await _context.AddAsync(type); await _context.SaveChangesAsync(); return(true); } catch (Exception) { return(false); } }
public async Task <bool> SaveChangesAsync(ComponentTypeDetail detail) { try { if (detail.Id == 0) { await _context.AddAsync(detail); } else { _context.Update(detail); } await _context.SaveChangesAsync(); return(true); } catch (Exception) { return(false); } }
public async Task <bool> SaveChangesAsync(UnitMultiplier multiplier) { try { if (multiplier.Id == 0) { await _context.AddAsync(multiplier); } else { _context.Update(multiplier); } await _context.SaveChangesAsync(); return(true); } catch (Exception) { return(false); } }