Ejemplo n.º 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!");
            }
        }
Ejemplo n.º 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!");
                }
            }
        }