public void Update(AdditionalServiceEntity addServ) { try { _context.Entry(addServ).State = EntityState.Modified; _context.SaveChanges(); } catch { throw new NotImplementedException(); } }
public void Add(AdditionalServiceEntity addServ) { try { _context.AdditionalServices.Add(addServ); _context.SaveChanges(); } catch { throw new NotImplementedException(); } }
public async Task UpsertAdditionalServiceAsync(AdditionalServiceEntity additionalServiceEntity) { try { using (IDbConnection dbConnection = new SqlConnection(_settings.ConnectionString)) { await dbConnection.QuerySingleOrDefaultAsync( "UpsertAdditionalService", additionalServiceEntity, commandType : CommandType.StoredProcedure ); } } catch (SqlException e) { throw new UniqueIndexException("UpsertAdditionalService", e); } }