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

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

        if (authorIsCaller)
        {
            EditPostCommand.Execute(new { post.Content });
        }
    }
Ejemplo n.º 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);
        }
    }