Пример #1
0
        public GenericResponse <StaticPage> DeleteStaticPage(int id)
        {
            GenericResponse <StaticPage> response = new GenericResponse <StaticPage>();

            repo.Delete(id);

            if (repo.Get(id) == null)
            {
                response.Success = true;
            }
            else
            {
                response.Success = false;
                response.Message = "ERROR : Static page was not removed from the database.";
                response.Payload = repo.Get(id);
            }

            return(response);
        }
Пример #2
0
        public GenericResponse <Post> DeletePost(int id)
        {
            GenericResponse <Post> response = new GenericResponse <Post>();

            repo.Delete(id);

            if (repo.Get(id) == null)
            {
                response.Success = true;
            }
            else
            {
                response.Success = false;
                response.Message = "ERROR : Post was not deleted from database.";
                response.Payload = repo.Get(id);
            }

            return(response);
        }