Ejemplo n.º 1
0
        internal Lego Edit(int id, Lego updatedLego)
        {
            Lego foundLego = GetById(id);

            //NOTE GetById() is already handling our null checking
            foundLego.Title = updatedLego.Title;
            return(_repo.Edit(foundLego));
        }
Ejemplo n.º 2
0
        internal Lego Edit(Lego update)
        {
            var exists = _repo.GetById(update.Id);

            if (exists == null)
            {
                throw new Exception("Invalid Id");
            }

            // update.AuthorId = exists.AuthorId

            _repo.Edit(update);
            return(update);
        }