public Document[] GetAllDocumentPerson(int idperson) { try { using (var c = new Connect()) { SqlConnection sqlconn = c.GetConnection(); var mapper = new DocumentDataMapper(sqlconn); IEnumerable <Document> list = mapper.GetAll().Where(d => d.Person.Id == idperson); return(list.ToArray()); } } catch (Exception exception) { throw new FaultException <ServerError>(new ServerError()); } }
public Document[] GetAllDocumentPerson(int idperson) { try { using (var c = new Connect()) { SqlConnection sqlconn = c.GetConnection(); var mapper = new DocumentDataMapper(sqlconn); IEnumerable<Document> list = mapper.GetAll().Where(d => d.Person.Id == idperson); return list.ToArray(); } } catch (Exception exception) { throw new FaultException<ServerError>(new ServerError()); } }