コード例 #1
0
 public CuentaRepository(BillycockServiceContext context, ICommonRepository <Cuenta> commonRepository,
                         IPlataformaCuentaRepository plataformaCuentaRepository, IPlataformaRepository plataformaRepository)
 {
     _context                    = context;
     _commonRepository           = commonRepository;
     _plataformaCuentaRepository = plataformaCuentaRepository;
     _plataformaRepository       = plataformaRepository;
 }
コード例 #2
0
 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);
     }
 }
コード例 #3
0
        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);
        }
コード例 #4
0
 public EstadoController(BillycockServiceContext context)
 {
     _context = context;
 }
コード例 #5
0
 public PlataformaController(BillycockServiceContext context)
 {
     _context = context;
 }
コード例 #6
0
 public PlataformaCuentaRepository(BillycockServiceContext context, ICommonRepository <PlataformaCuentaDTO> commonRepository)
 {
     _context          = context;
     _commonRepository = commonRepository;
 }
コード例 #7
0
 public async Task Save(BillycockServiceContext _context)
 {
     await _context.SaveChangesAsync();
 }
コード例 #8
0
 public EstadoRepository(BillycockServiceContext context, ICommonRepository <Estado> commonRepository)
 {
     _context          = context;
     _commonRepository = commonRepository;
 }