Calculate position of the Sun in ECEF
SOFA is the Standards Of Fundamental Astronomy, approved by the International Astronomical Union (IAU) as being the canonical standard for calculating positions and time in astronomy. It is available in C and F77 versions as standard, and wrappers have been written in other languages, most notably Python as part of AstroPy. For your purpose, the thirdparty part of the website mentions the World Wide Astronomy (WWA) library which is C# so that would be worth a look for your application. I would recommend reading the SOFA Cookbooks, particularly the ones on Earth Attitude and Time Scales to get a better idea of how the (many) various time and co-ordinate systems fit together.