Exemple #1
0
    public void DeletePost(int id)
    {
        bool authorIsCaller = IsPostAuthorMatch <bool> .Execute(new { post.Author });

        if (authorIsCaller)
        {
            DeletePostCommand.Execute(new { Id = id });
        }
    }
Exemple #2
0
    public void EditPost(Post post)
    {
        bool authorIsCaller = IsPostAuthorMatch <bool> .Execute(new { post.Author });

        if (authorIsCaller)
        {
            EditPostCommand.Execute(new { post.Content });
        }
    }
Exemple #3
0
    public void EditPost(Post post)
    {
        bool authorIsCaller = IsPostAuthorMatch <bool> .Execute(new { post.Author });

        if (authorIsCaller)
        {
            EditPostCommand.Execute(new { post.Content });

            var hash = HashObject(post).ToHexString();

            Connector connector = new Connector(credentialManager.PublicKey, credentialManager.PrivateKey);
            connector.Call("editPostHash", post.Id, hash);
        }
    }