コード例 #1
0
        public async Task <IActionResult> GetPhotosByPenjualanId(int Id)
        {
            List <Photo> photos = context.GetPhotoByPenjualanId(Id);


            foreach (var item in photos)
            {
                item.Thumb = await context.GetThumb(item);
            }
            return(Ok(photos));
        }
コード例 #2
0
        // GET: api/Photos
        public async Task <IHttpActionResult> GetPhotosByPenjualanId(int Id)
        {
            PhotoContext  context = new PhotoContext();
            List <IPhoto> photos  = context.GetPhotoByPenjualanId(Id);


            foreach (var item in photos)
            {
                var path = HttpContext.Current.Server.MapPath(string.Format("~/{0}/", item.Path));
                context    = new PhotoContext(path);
                item.Thumb = await context.GetThumb(item);
            }
            return(Ok(photos));
        }