예제 #1
0
        public void DeleteZone(Guid id)
        {
            var Zone = new Zone();

            if (id != null)
            {
                Zone = _ZoneRepositorý.GetById(id);

                if (Zone != null)
                {
                    _ZoneRepositorý.Delete(Zone);
                }
            }
        }
예제 #2
0
 public IActionResult Delete(int id)
 {
     if ((new[] { "Admin" }).Contains(ValidateTokenAndRole.ValidateAndGetRole(Request), StringComparer.OrdinalIgnoreCase))
     {
         if (repo.GetOne(id) == null)
         {
             return(NotFound());
         }
         else
         {
             repo.Delete(id);
             return(Ok());
         }
     }
     else
     {
         return(Unauthorized());
     }
 }