예제 #1
0
        public async Task <ActionResult <FimBankBranch> > PostFimBankBranch(FimBankBranch fimBankBranch)
        {
            _context.FimBankBranches.Add(fimBankBranch);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetFimBankBranch", new { id = fimBankBranch.Id }, fimBankBranch));
        }
예제 #2
0
        public async Task <IActionResult> PutFimBankBranch(int id, FimBankBranch fimBankBranch)
        {
            if (id != fimBankBranch.Id)
            {
                return(BadRequest());
            }

            _context.Entry(fimBankBranch).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!FimBankBranchExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }