I need to store View(.cshtml) as string in web api

Hi All,
i am using web api in my project,i have to render view(.cshtml) to string at runtime ,because i have to insert mail template(.cshtml) as string in database at runtime ,in that template i a have some dynamic values in viewbag
Please suggest me how to achieve