public override IRecord GetRecord() { if (_record == null) { if (RecordType.IsNullOrWhiteSpace()) { throw new NullReferenceException("Record Tyoe Is Empty"); } _record = RecordService.NewRecord(RecordType); } return(_record); }
protected virtual void LoadRecord() { if (RecordId.IsNullOrWhiteSpace()) { throw new NullReferenceException("Record Id Cannot Be Empty When Loading The Record"); } if (RecordType.IsNullOrWhiteSpace()) { throw new NullReferenceException("Record Type Cannot Be Empty When Loading The Record"); } if (RecordIdName.IsNullOrWhiteSpace()) { RecordIdName = RecordService.GetPrimaryKey(RecordType); } _record = RecordService.GetFirst(RecordType, RecordIdName, RecordId); }