Exemplo n.º 1
0
        public Division CreateDivision(Division division)
        {
            if (division == null)
            {
                return(null);
            }

            _parkSharkDbContext.Add(division);
            _parkSharkDbContext.SaveChanges();

            return(division);
        }
Exemplo n.º 2
0
        public Division CreateDivision(Division division)
        {
            //Throw exception, make it explicit : throw new ArgumentException("division should not be null");
            if (division == null)
            {
                return(null);
            }

            _parkSharkDbContext.Add(division);
            _parkSharkDbContext.SaveChanges();

            return(division);
        }
Exemplo n.º 3
0
        public Member CreateNewMember(DummyMemberObject dummyMember)
        {
            MembershipLevel membershipLevel = AssignMembershipLevelFromDummyMember(dummyMember);

            if (membershipLevel == null)
            {
                return(null);
            }

            Member newMember = CreateMemberFromDummyObjectsAndMembershipLevel(dummyMember, membershipLevel);

            if (newMember == null)
            {
                return(null);
            }
            _parkSharkDBContext.Add(newMember);
            _parkSharkDBContext.SaveChanges();

            return(newMember);
        }