public async Task <ImgTwinModel> GetById(int id, int businessId) { var path = await _foldersRepo.GetPathByChildId(id); var sb = new StringBuilder(); foreach (var folder in path) { sb.Append("/" + folder.folder); } var child = path.LastOrDefault(); if (child == null) { return(null); } return(new ImgTwinModel { folder = child.folder, id = child.id, fullpath = sb.ToString(), isFile = false }); }