Get SHA-256 in C#
I am converting my Java code to C#. I am not able to convert the following function from Java to C#. The fumction is calling the Update method twice. I have tried the C# code in following manner

    SHA256 sh = SHA256.Create();
                Encoding shEncoding = Encoding.UTF7;
                byte[] data = shEncoding.GetBytes(sn);
                byte hash = sh.ComputeHash(data);
But I don't know how to convert two consecutive update function call in C#.

    String getSHA(byte[] sf,String sn,byte[] mac) throws NoSuchAlgorithmException 
        {
    
            MessageDigest md = MessageDigest.getInstance("SHA-256");
            md.update(sf);
            md.update(sn.getBytes());
            byte[] hash = md.digest(mac);
            StringBuilder sb = new StringBuilder();
            for(byte b : hash) {
                sb.append(String.format("%02x", b));
            }
    
    
           return sb.toString();
        }

Thanks in Advance. 

Your help/guidance will help me lot.
Get SHA-256 in C#
===

I am converting my Java code to C#. I am not able to convert the following function from Java to C#. The fumction is calling the Update method twice. I have tried the C# code in following manner

    SHA256 sh = SHA256.Create();
                Encoding shEncoding = Encoding.UTF7;
                byte[] data = shEncoding.GetBytes(sn);
                byte hash = sh.ComputeHash(data);
But I don't know how to convert two consecutive update function call in C#.

    String getSHA(byte[] sf,String sn,byte[] mac) throws NoSuchAlgorithmException 
        {
    
            MessageDigest md = MessageDigest.getInstance("SHA-256");
            md.update(sf);
            md.update(sn.getBytes());
            byte[] hash = md.digest(mac);
            StringBuilder sb = new StringBuilder();
            for(byte b : hash) {
                sb.append(String.format("%02x", b));
            }
    
    
           return sb.toString();
        }

Thanks in Advance. 

Your help/guidance will help me lot.