Esempio n. 1
0
        public async Task <ActionResult <Photo> > GetProjectPhotos(int id)
        {
            try
            {
                var photo = await _photo.ListPhotos(id);

                if (photo == null)
                {
                    ResponseViewModel Response1 = new ResponseViewModel(false, HttpStatusCode.NoContent, "NoContent", null);
                    return(Ok(Response1));
                }
                var Response = new ResponseViewModel(true, HttpStatusCode.OK, "SUCCESS", photo);
                return(Ok(Response));
            }
            catch (Exception)
            {
                var Response = new ResponseViewModel(false, HttpStatusCode.BadRequest, "failed", null);
                return(Ok(Response));
            }
        }