public bool RegisterObject(object modelObject, object parentObject = null) { try { var t = modelObject.GetType(); var a = t.GetCustomAttribute <UaObject>(); if (a == null) { throw new Exception( $"Cannot register UA object for type {t.Name}, it's not annotated with 'UaObject'!"); } } catch (Exception e) { ExceptionHandler.Log(e); return(false); } BusinessModel?.Add(new BoCapsule(modelObject)); return(true); }