Beispiel #1
0
        public async Task <IActionResult> Delete(string id)
        {
            var result = await _socialNetworkService.Delete(id);

            if (result.Code <= 0)
            {
                return(BadRequest(result));
            }

            return(Ok(result));
        }
Beispiel #2
0
        public ActionResult SocialNetworkDelete(int id, GridCommand command)
        {
            var socialNetwork = socialNetworkService.GetById(id);

            if (socialNetwork != null)
            {
                var entityId = socialNetwork.EntityId;
                socialNetworkService.Delete(socialNetwork);
                return(SocialNetworkList(command, entityId));
            }
            return(SocialNetworkList(command, "-1"));
        }
Beispiel #3
0
        public async Task <IActionResult> DeleteSocialNetwork(short id)
        {
            var socialNetwork = await _socialNetworkService.GetAll().AsNoTracking().FirstOrDefaultAsync(s => s.Id == id);

            var result = false;

            try
            {
                await _socialNetworkService.Delete(socialNetwork);

                result = true;
            }
            catch { }
            return(new JsonResult(new
            {
                result = result
            }));
        }