Esempio n. 1
0
        public virtual int GetOrCreateID(string login)
        {
            if (string.IsNullOrEmpty(login))
                throw new ArgumentException("Login inválido.");

            int id = DAL.GetIdByLogin(login);

            if (id == 0)
            {
                var professional = new HungryProfessional { Login = login };

                DAL.AddProfessional(professional);

                id = professional.Id;
            }

            return id;
        }
Esempio n. 2
0
        public virtual void AddProfessional(HungryProfessional professional)
        {
            professional = LPContext.HungryProfessional.Add(professional);

            LPContext.SaveChanges();
        }