C#
Code
# Code
```csharp []
public class Solution {
    public int FindMaxFish(int[][] grid) {
            int m = grid.Length;
    int n = grid[0].Length;
    int maxFish = 0;

    // Directions for moving up, down, left, right
    int[][] directions = new int[][] {
    new int[] { 1, 0 }, // down
    new int[] { -1, 0 }, // up
    new int[] { 0, 1 }, // right
    new int[] { 0, -1 } // left
};

    // Helper function for DFS
    int Dfs(int r, int c)
    {
        // Check for out of bounds or land cell
        if (r < 0 || r >= m || c < 0 || c >= n || grid[r][c] == 0)
        {
            return 0;
        }
        // Count fish in the current cell
        int fish = grid[r][c];
        // Mark the cell as visited by setting it to 0
        grid[r][c] = 0;
        int totalFish = fish; // Start with the fish in the current cell

        // Explore all four directions
        foreach (var dir in directions)
        {
            totalFish += Dfs(r + dir[0], c + dir[1]);
        }
        return totalFish;
    }

    // Iterate through the grid
    for (int i = 0; i < m; i++)
    {
        for (int j = 0; j < n; j++)
        {
            if (grid[i][j] > 0)
            { // If it's a water cell
                maxFish = Math.Max(maxFish, Dfs(i, j)); // Perform DFS and update maxFish
            }
        }
    }

    return maxFish;
    }
}
```
['C#']