Beispiel #1
0
        public IActionResult GetAllClasses()
        {
            List <ReponseGetAllClasses> response = new List <ReponseGetAllClasses>();
            var classes = _classServices.GetAllClasses().ToList();

            Global.Mapper.Map(classes, response);
            foreach (var item in response)
            {
                var members = _memberServices.GetMemberByClassId(item.Id);
                List <ResponseSelectMember> responseMember = new List <ResponseSelectMember>();
                Global.Mapper.Map(members, responseMember);
                item.Member = responseMember;
            }
            return(Ok(response));
        }