public string getPhoto(string name) { PhotoEntity photo = new PhotoEntity(); photo = (PhotoEntity)createEntity(pathPhoto + "\\" + name, photo); if (photo != null) { return(utils.getJson(photo)); } return("{No photo with this name.}"); }
public string getAllPhoto() { List <PhotoEntity> photos = new List <PhotoEntity>(); string[] dirs = Directory.GetFiles(pathPhoto, "*"); foreach (string file in dirs) { PhotoEntity p = new PhotoEntity(); p = (PhotoEntity)createEntity(file, p); if (p != null) { photos.Add(p); } } return(utils.getJson(photos)); }