示例#1
0
        public Brick Edit(Brick editBrick)
        {
            Brick original = Get(editBrick.Id);

            original.Name        = editBrick.Name.Length > 0 ? editBrick.Name : original.Name;
            original.Color       = editBrick.Color != null ? editBrick.Color : original.Color;
            original.Description = editBrick.Description.Length > 0 ? editBrick.Description : original.Description;
            return(_repo.Edit(original));
        }
示例#2
0
        internal Brick Edit(Brick update)
        {
            var exists = _repo.GetById(update.Id);

            if (exists == null)
            {
                throw new Exception("Invalid ID");
            }
            _repo.Edit(update);
            return(update);
        }
示例#3
0
        internal Brick Edit(Brick update)
        {
            var found = _repo.GetById(update.Id);

            if (found == null)
            {
                throw new Exception("Invalid Id bro");
            }
            //update.AuthorId = found.AuthorId;
            _repo.Edit(update);
            return(update);
        }
示例#4
0
        internal Brick Edit(Brick editBrick)
        {
            Brick original = Get(editBrick.Id);

            original.Color = editBrick.Color != null ? editBrick.Color : original.Color;

            original.Name = editBrick.Name != null ? editBrick.Name : original.Name;

            original.Description = editBrick.Description != null ? editBrick.Description : original.Description;

            return(_repo.Edit(original));
        }