Exemplo n.º 1
0
        internal Castle Edit(int id, Castle castle)
        {
            Castle original = Get(id);

            original.Name     = castle.Name != null ? castle.Name : original.Name;
            original.Year     = castle.Year > -999 ? castle.Year : original.Year;
            original.Size     = castle.Size != null ? castle.Size : original.Size;
            original.KingName = castle.KingName != null ? castle.KingName : original.Size;
            return(_repo.Edit(original));
        }
Exemplo n.º 2
0
        internal Castle Edit(Castle updated)
        {
            Castle data = GetById(updated.Id);

            //null check properties you are editing in repo
            data.Name    = updated.Name != null ? updated.Name : data.Name;
            data.King    = updated.King != null ? updated.King : data.King;
            data.Country = updated.Country != null ? updated.Country : data.Country;

            return(_repo.Edit(data));
        }
Exemplo n.º 3
0
        internal Castle Edit(Castle updated)
        {
            // REVIEW
            Castle data = GetById(updated.Id);

            //null check properties you are editing in repo
            data.Name        = updated.Name != null ? updated.Name : data.Name;
            data.Description = updated.Description != null ? updated.Description : data.Description;
            data.Age         = updated.Age != null ? updated.Age : data.Age;

            return(_repo.Edit(data));
        }