public JsonResult FolderLists() { List <GoogleDriveFile> AllFolders = GoogleDriveFilesRepository.GetDriveFolders(); List <DDLOptions> obj = new List <DDLOptions>(); foreach (GoogleDriveFile EachFolder in AllFolders) { obj.Add(new DDLOptions { Id = EachFolder.Id, Name = EachFolder.Name }); } return(Json(obj, JsonRequestBehavior.AllowGet)); }