public GenericResponse <StaticPage> EditStaticPage(StaticPage staticPage) { GenericResponse <StaticPage> response = new GenericResponse <StaticPage>(); repo.Edit(staticPage); if (repo.Get(staticPage.Id) == staticPage) { response.Success = true; response.Payload = repo.Get(staticPage.Id); } else { response.Success = false; response.Message = "ERROR : Static Page was not updated within database."; response.Payload = staticPage; } return(response); }
public GenericResponse <Post> EditPost(Post post) { GenericResponse <Post> response = new GenericResponse <Post>(); repo.Edit(post); if (repo.Get(post.Id) == post) { response.Success = true; response.Payload = repo.Get(post.Id); } else { response.Success = false; response.Message = "ERROR : Post was not edited within database."; response.Payload = post; } return(response); }