Ejemplo n.º 1
0
        public T Add(T itemToAdd)
        {
            var entity = dbContext.Add <T>(itemToAdd);

            dbContext.SaveChanges();
            return(entity.Entity);
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> Create([Bind("TransactionId,ExternalIBAN,ExternalName,Amount,Time,Details,Status")] Transaction transaction)
        {
            if (ModelState.IsValid)
            {
                _context.Add(transaction);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(transaction));
        }
        public async Task <IActionResult> Create([Bind("ContactDetailId,Adress,City,Country,PhoneNo,AlternatePhoneNo,Email")] ContactDetails contactDetail)
        {
            if (ModelState.IsValid)
            {
                _context.Add(contactDetail);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(contactDetail));
        }
        public async Task <IActionResult> Create([Bind("RequestId,Type,SendDate")] Request request)
        {
            if (ModelState.IsValid)
            {
                _context.Add(request);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(request));
        }
Ejemplo n.º 5
0
        public async Task <IActionResult> Create([Bind("LoanId,Value,StartDate,EndDate,LunarFee")] Loan loan)
        {
            if (ModelState.IsValid)
            {
                _context.Add(loan);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(loan));
        }
Ejemplo n.º 6
0
 public async Task <Account> InsertAsync(Account account)
 {
     _context.Add(account);
     try
     {
         await _context.SaveChangesAsync();
     }
     catch (Exception)
     {
     }
     return(account);
 }
 public Account Post(Account account)
 {
     _context.Add(account);
     _context.SaveChanges();
     return(account);
 }
 public void Save(Account account)
 {
     _ctx.Add(account);
     _ctx.SaveChanges();
 }