Пример #1
0
        public static ParentInfo GetParentInfo(int parentID)
        {
            using (SchoolJournalEntities context = new SchoolJournalEntities())
            {
                Parent p = context.Set<Parent>().Find(parentID);

                if (p != null)
                {
                    ParentInfo info = new ParentInfo(p);
                    return info;
                }
                else throw new ArgumentOutOfRangeException("Parent ID was not found in the DB!");
            }
        }
Пример #2
0
        public static ParentInfo GetParentInfo(int parentID)
        {
            using (SchoolJournalEntities context = new SchoolJournalEntities())
            {
                Parent p = context.Set <Parent>().Find(parentID);

                if (p != null)
                {
                    ParentInfo info = new ParentInfo(p);
                    return(info);
                }
                else
                {
                    throw new ArgumentOutOfRangeException("Parent ID was not found in the DB!");
                }
            }
        }