static void Main(string[] args)
    {
        // create a ManagerRepository somewhere
        ManagerRepository repository = new ManagerRepository();

        // register create delegates for each type of Manager
        repository.RegisterCreate <ManagerSomething1>(dr => new ManagerSomething1(dr));
        repository.RegisterCreate <ManagerSomething2>(dr => new ManagerSomething2(dr));
        // use the repository
        int         managerID = 5;
        bool        withUsers = false;
        ManagerBase manager   = repository.GetManager(managerID, withUsers);
    }
Example #2
0
        public IActionResult GetSingle(int id)
        {
            Manager manager;

            try
            {
                manager = _repo.GetManager(id);
            }
            catch (Exception e)
            {
                return(StatusCode((int)HttpStatusCode.InternalServerError,
                                  "Sorry, something went wrong. Please try again later."));
            }

            return(StatusCode((int)HttpStatusCode.OK, manager));
        }
Example #3
0
 public async Task <ManagerDTO> GetManagerById(int id)
 {
     return(await mRepository.GetManager(id));
 }
Example #4
0
 public List <Manager> GetManager()
 {
     return(_repository.GetManager());
 }
 public Manager ViewProfile(string jmbg)
 {
     return(managerRepository.GetManager(jmbg));
 }