Pass null value to Guid Parameter

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • JustRun
    New Member
    • Mar 2008
    • 127

    Pass null value to Guid Parameter

    Hi,
    I have a method which receive a Guid param, How to call it passing null to this param?
    Code:
    public void AddNewRecord(Guid _userId)
    {
    
    }
    
    // Call it here:
    
    AddNewRecord(want to pass null !!)
    Thanks
  • JustRun
    New Member
    • Mar 2008
    • 127

    #2
    isn't there any Nudge here :) just to beep to ppl and answer me

    Comment

    • artov
      New Member
      • Jul 2008
      • 40

      #3
      Guid is a structure, so you cannot pass a null to your method. You either have to create a class that contains the guid as a field, or use Nullable<Guid> as the parameter.

      Comment

      • IanWright
        New Member
        • Jan 2008
        • 179

        #4
        What artov said...

        Or use Guid.Empty;

        Comment

        Working...