public static Comment RetrieveOrCreate(int? id) { var comment = new Comment {OwnerID = Requester.Logged.ID}; comment = (DataPortal.Instance.Retrieve(typeof (Comment), id) as Comment) ?? comment; return comment; }
public static bool TryRetrieve(int? id, out Comment comment) { try { comment = (DataPortal.Instance.Retrieve(typeof(Comment), id) as Comment); return comment != null; } catch (Exception) { comment = null; return false; } }