public async Task<PornTitle> GetSingleTitle() { string acceptLanguage = Request.Headers.AcceptLanguage.ToString(); var nameTask = Task<string>.Factory.StartNew(() => Generator.GetRandomName(acceptLanguage)); var titleTask = Task<string>.Factory.StartNew(() => Generator.GetRandomTitle(acceptLanguage)); string result = string.Concat(await nameTask, " ", await titleTask); var pornTitle = new PornTitle { Title = result, ButtonText = Generator.GetRandomButtonText(acceptLanguage) }; return pornTitle; }
public async Task <PornTitle> GetSingleTitle() { string acceptLanguage = Request.Headers.AcceptLanguage.ToString(); var nameTask = Task <string> .Factory.StartNew(() => Generator.GetRandomName(acceptLanguage)); var titleTask = Task <string> .Factory.StartNew(() => Generator.GetRandomTitle(acceptLanguage)); string result = string.Concat(await nameTask, " ", await titleTask); var pornTitle = new PornTitle { Title = result, ButtonText = Generator.GetRandomButtonText(acceptLanguage) }; return(pornTitle); }