How to set null to a GUID property

后端 未结 8 1927
春和景丽
春和景丽 2020-12-16 10:25

I have an object of type Employee which has a Guid property. I know if I want to set to null I must to define my type property as nullable Nullable

8条回答
  •  星月不相逢
    2020-12-16 10:40

    You can use typeof(Guid), "00000000-0000-0000-0000-000000000000" for DefaultValue of the property.

提交回复
热议问题