Exemple #1
0
        public Magazin Post(MagazinDTO value)
        {
            Magazin model = new Magazin()
            {
                Nume   = value.Nume,
                Adresa = value.Adresa
            };

            return(IMagazinRepository.Create(model));
        }
Exemple #2
0
        public Magazin Put(int id, MagazinDTO value)
        {
            Magazin model = IMagazinRepository.Get(id);

            if (value.Nume != null)
            {
                model.Nume = value.Nume;
            }

            if (value.Adresa != null)
            {
                model.Adresa = value.Adresa;
            }

            return(IMagazinRepository.Update(model));
        }