Пример #1
0
 public UnitTest1(IServiceProvider provider, UserManager <User> userManager, RoleManager <IdentityRole> roleManager, IConfiguration configuration)
 {
     _repo             = new PersonManagement(provider);
     _service          = new PersonService(_repo);
     _authController   = new AuthenticateController(userManager, roleManager, configuration);
     _personController = new PeopleController(_service);
 }
Пример #2
0
        public GetPersonResponse GetPerson(GetPersonRequest getRequest)
        {
            _log.Debug("InvokePersonManagementService.GetPerson() starting ...");
            PersonManagementClient client   = null;
            GetPersonResponse      response = null;

            try
            {
                client = new PersonManagementClient();
                _log.Debug("client created successfully");
                IPersonManagement pm = (IPersonManagement)client;
                response = pm.GetPerson(getRequest);
                _log.Debug("response was received from ODS PersonManagement service");
            }
            catch (TimeoutException timeout)
            {
                _log.Error("InvokePersonManagementService.GetPerson() Timeout Exception:" + timeout.Message);
                ProxyHelper.HandleServiceException(client);
            }
            catch (CommunicationException comm)
            {
                _log.Error("InvokePersonManagementService.GetPerson() Communication Exception:" + comm.Message);
                ProxyHelper.HandleServiceException(client);
            }
            catch (Exception e)
            {
                _log.Error("InvokePersonManagementService.GetPerson() Exception:" + e.Message);
            }
            finally
            {
                if (client != null && client.State != CommunicationState.Closed)
                {
                    ProxyHelper.CloseChannel(client);
                }
            }

            _log.Debug("InvokePersonManagementService.GetPerson() ending ...");
            return(response);
        }
 public PersonService(IPersonManagement repo)
 {
     _repo = repo;
 }
Пример #4
0
 public PersonController(IPersonManagement personManagement)
 {
     _personManagement = personManagement;
 }