public CuentaRepository(BillycockServiceContext context, ICommonRepository <Cuenta> commonRepository, IPlataformaCuentaRepository plataformaCuentaRepository, IPlataformaRepository plataformaRepository) { _context = context; _commonRepository = commonRepository; _plataformaCuentaRepository = plataformaCuentaRepository; _plataformaRepository = plataformaRepository; }
public async Task InsertHistory(T t, string response, BillycockServiceContext _context) { try { await _context.AddAsync(new Historia() { Request = JsonConvert.SerializeObject(t), Response = response, fecha = DateTime.Now }); await Save(_context); } catch (Exception ex) { Console.WriteLine(ex.Message); } }
public async Task <string> UpdateObjeto(T tracker, T t, BillycockServiceContext _context) { string mensaje = ("Actualizacion XXX de " + t.GetType().Name).ToUpper(); try { _context.Entry(tracker).State = EntityState.Detached; _context.Update(t); await Save(_context); mensaje = mensaje.Replace("XXX", "Correcta").ToUpper(); } catch (Exception ex) { Console.WriteLine(ex.Message); mensaje = mensaje.Replace("XXX", "Incorrecta").ToUpper(); } await InsertHistory(t, mensaje, _context); return(mensaje); }
public EstadoController(BillycockServiceContext context) { _context = context; }
public PlataformaController(BillycockServiceContext context) { _context = context; }
public PlataformaCuentaRepository(BillycockServiceContext context, ICommonRepository <PlataformaCuentaDTO> commonRepository) { _context = context; _commonRepository = commonRepository; }
public async Task Save(BillycockServiceContext _context) { await _context.SaveChangesAsync(); }
public EstadoRepository(BillycockServiceContext context, ICommonRepository <Estado> commonRepository) { _context = context; _commonRepository = commonRepository; }