Beispiel #1
0
        public ActionResult <List <StaffViewModel> > List()
        {
            var res = _bo.List();

            if (!res.Success)
            {
                return(InternalServerError());
            }
            var list = new List <StaffViewModel>();

            foreach (var item in res.Result)
            {
                list.Add(StaffViewModel.Parse(item));
            }
            return(list);
        }
Beispiel #2
0
        public ActionResult <StaffViewModel> Get(Guid id)
        {
            var res = _bo.Read(id);

            if (res.Success)
            {
                if (res.Result == null)
                {
                    return(NotFound());
                }
                var vm = StaffViewModel.Parse(res.Result);
                return(vm);
            }
            else
            {
                return(InternalServerError());
            }
        }