コード例 #1
0
        public IActionResult DeletePhotoForCar(Photo photo)
        {
            var result = _photoManager.Delete(photo);

            if (result.Success)
            {
                return(Ok(result));
            }
            return(BadRequest(result));
        }
コード例 #2
0
        public JsonResult Delete(int photoId, int userId)
        {
            if (userId == CurrentUser.Id)
            {
                var success = _photoManager.Delete(photoId);

                return(new JsonResult {
                    Data = new { Success = true }
                });
            }

            return(new JsonResult {
                Data = new { Success = false }
            });
        }
コード例 #3
0
        public JsonResult Delete(int?id)
        {
            if (id.HasValue && CurrentUser.IsAdministrator)
            {
                var success = _photoManager.Delete(id.Value);

                if (success > 0)
                {
                    return(new JsonResult {
                        Data = new { Success = true }
                    });
                }
            }

            return(new JsonResult {
                Data = new { Success = false }
            });
        }