@Patil, Kiran Thanks for reaching out to Microsoft Q&A. Based on the shared information, I have understood that you want to add the custom domain to Azure Communication Email Service through code using C#.
Azure communication Email service can be created or managed by any of these listed SDK's( JavaScript, .NET ,Python, Java SE, iOS, Android) and using SDK you can either send email or get status of the email are supported by email client libraries as mentioned here.
Alternatively, to achieve your requirement, you need to use/call this Domains- Create\Update Rest API of Email Service from your C# code. I hope the answer helps. Please let me know if you have any further queries.
Please accept as Yes if the answer provided is useful, so that you can help others in the community looking for remediation for similar issues.