What is Opf3? Why is Opf3? How is Opf3? All these burning questions and issues discussed here.
 | |
| | I have a property of a business object that maps to a unique identifier field in a SqlServer database. In C# the property uses a Guid as below.
private Guid _rateCodeId; [Field("RateCodeId", AllowDBNull = true)] public Guid RateCodeId { get { return _rateCodeId; } set { _rateCodeId = value; } }
Can you suggest how I might set this field to null as Guid does not accept null. What technique would you advise.
Thanks
|
 | |
| | Hi!
.NET 2.0 supports nullable types. In C# you only put a ? after the type declaration. Like for example with a guid:
private Guid? _id = null;
These types allow then to be set to null Opf3 detects that and saves a dbnull.
I hope this helps.
Greetings, Christian
|