Esempio n. 1
0
        static RectangleShape FromJson(RectangleDetail detail)
        {
            var shape = RectangleShape.GetById(detail.Id) ?? new RectangleShape();

            shape.Id    = detail.Id;
            shape.Color = detail.Color;
            return(shape);
        }
Esempio n. 2
0
 public bool Delete(Guid id)
 {
     try
     {
         var shape = RectangleShape.GetById(id);
         shape.MarkForDeletion();
         shape.Save();
         return(true);
     }
     catch (NullReferenceException ex)
     {
         return(false);
     }
 }
Esempio n. 3
0
 public RectangleDetail FindById(Guid id)
 {
     return(ToJson(RectangleShape.GetById(id)));
 }