public async Task<string> InserirAsync(Pagamento oPagamento) { try { return await Pagamento.InserirAsync(oPagamento); } catch (Exception ex) { return ex.Message; } }
public async static Task <string> InserirAsync(Pagamento oPagamento) { using (var oDB = new CAPEntities()) { try { oDB.Pagamento.Add(oPagamento); await oDB.SaveChangesAsync(); return(null); } catch (Exception ex) { return(ex.ToString()); } } }
public async static Task <string> AlterarAsync(Pagamento oPagamento) { using (var oDB = new CAPEntities()) { try { oDB.Pagamento.Attach(oPagamento); oDB.Entry(oPagamento).State = EntityState.Modified; await oDB.SaveChangesAsync(); return(null); } catch (Exception ex) { return(ex.ToString()); } } }