saintar1997 / CustomerAPI

Methods that deal with async should have their names suffixed with Async CS-R1073
Anti-pattern
Major
a year agoa year old
Method with return type Task does not follow the naming convention
60        }
61
62        [HttpDelete("{id}")]
63        public async Task<ActionResult<List<Customer>>> Delete(int id)64        {
65            var dbCustomer = await _context.Customers.FindAsync(id);
66            if (dbCustomer == null)
Method with return type Task does not follow the naming convention
40        }
41
42        [HttpPut]
43        public async Task<ActionResult<List<Customer>>> Update(Customer request)44        {
45            var dbCustomer = await _context.Customers.FindAsync(request.Id);
46            if (dbCustomer == null)
Method with return type Task does not follow the naming convention
31
32
33        [HttpPost]
34        public async Task<ActionResult<List<Customer>>> AddHero(Customer customer)35        {
36            _context.Customers.Add(customer);
37            await _context.SaveChangesAsync();
Method with return type Task does not follow the naming convention
21        }
22
23        [HttpGet("{id}")]
24        public async Task<ActionResult<List<Customer>>> Get(int id)25        {
26            var customer = await _context.Customers.FindAsync(id);
27            if (customer == null)
Method with return type Task does not follow the naming convention
15        }
16
17        [HttpGet]
18        public async Task<ActionResult<Customer>> Get()19        {
20            return Ok(await _context.Customers.ToListAsync());
21        }