Beispiel #1
0
        public async Task <ActionResult <Furs2Feathers.Domain.Models.Plan> > DeletePlan(int id)
        {
            var plan = await planRepo.FindAsyncAsNoTracking(id); // get this plan matching this id

            // with tracking there are id errors even with just one row in the database so using AsNoTracking instead
            if (plan == null)
            {
                return(NotFound());
            }

            planRepo.Remove(plan);
            await planRepo.SaveChangesAsync();

            return(NoContent());
        }