Exemplo n.º 1
0
        public List <Person> GetPersons()
        {
            //throw new NullReferenceException();
            IPersonDataRepo repo    = dataRepo.GetDataRepository <IPersonDataRepo>();
            List <Person>   persons = repo.GetPersons();

            return(persons);
            //return ExecuteFaultHandler(() =>
            // {
            //     int count = 0;
            //     count = count / 0;
            //     IPersonDataRepo repo = dataRepo.GetDataRepository<IPersonDataRepo>();
            //     List<Person> persons = repo.GetPersons();
            //     return persons;
            // });
            //try
            //{
            //    int count = 0;
            //    count = count / 0;
            //    IPersonDataRepo repo = dataRepo.GetDataRepository<IPersonDataRepo>();
            //    List<Person> persons = repo.GetPersons();
            //    return persons;
            //}
            //catch (Exception ex)
            //{
            //    throw new FaultException(ex.Message + Environment.NewLine + ex.StackTrace);
            //    //throw new FaultException<Exception>(ex);
            //}
        }
Exemplo n.º 2
0
        public int AddPerson(Person person)
        {
            try
            {
                IPersonDataRepo repository = dataRepo.GetDataRepository <IPersonDataRepo>();
                int             result     = repository.AddPerson(person);

                int count = 0;
                count = count / 0;
                return(result);
            }
            catch (Exception ex)
            {
                throw new FaultException(ex.Message + Environment.NewLine + ex.StackTrace);
            }
        }