public async Task <ApiResult <CertificateViewModel> > Item(int ID) { var res = new ApiResult <CertificateViewModel>(); Certificate m; CertificateViewModel n = new CertificateViewModel(); if (ID > 0) { m = Certificatedb.GetId(ID); if (m != null) { n = IMapper.Map <CertificateViewModel>(m); n.ProjectName = Projectdb.Get("Projects", m.ProjectID).Names; n.ProviderName = providerdb.GetId(m.ProviderID).Title; res.success = true; } } res.data = n; return(await Task.Run(() => res)); }