예제 #1
0
 public async Task <IHttpActionResult> GetRelatori(Guid?id)
 {
     try
     {
         return(Ok(await _logicPersone.GetRelatori(id)));
     }
     catch (Exception e)
     {
         Log.Error("GetRelatori", e);
         return(ErrorHandler(e));
     }
 }
예제 #2
0
        public async Task <IHttpActionResult> GetAtto(Guid id)
        {
            try
            {
                var attoInDB = await _logic.GetAtto(id);

                if (attoInDB == null)
                {
                    return(NotFound());
                }

                var result = Mapper.Map <ATTI, AttiDto>(attoInDB);
                result.Relatori = (await _logicPersone.GetRelatori(result.UIDAtto))
                                  .Select(Mapper.Map <PersonaDto, PersonaLightDto>);

                return(Ok(result));
            }
            catch (Exception e)
            {
                Log.Error("GetAtto", e);
                return(ErrorHandler(e));
            }
        }