public async Task <ApiResult <object> > GetadvertViewModel() { var res = new ApiResult <object>() { statusCode = (int)ApiEnum.Status }; FilterDefinition <ProjectTypeInfo> filter = Builders <ProjectTypeInfo> .Filter.Empty; var list = ProjectTypedb.GetList("ProjectType", filter); List <BaseViewModel1> advertlist = new List <BaseViewModel1>(); foreach (var item in list) { advertlist.Add(new BaseViewModel1(C.String(item._id), item.Names)); } res.data = advertlist; return(await Task.Run(() => res)); }