public ActionResult Singleton(string id) { DesignPatterns.单例模式.MultiThread_Singleton singleton = DesignPatterns.单例模式.MultiThread_Singleton.Instance; string str = singleton.test(); return(Content(str)); }
public ActionResult DesignPattern() { ViewBag.Message = "Your DesignPattern page."; DesignPatterns.单例模式.MultiThread_Singleton singleton = DesignPatterns.单例模式.MultiThread_Singleton.Instance; var str = singleton.test(); ViewBag.test = str; return(View()); }