Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8231745
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T17:35:52+00:00 2026-06-07T17:35:52+00:00

I have a guid? field in my POCO and when I create a new

  • 0

I have a guid? field in my POCO and when I create a new entry in my DB and look at it through SSMSE, I see NULL in that field. After choosing a manager for this new user entry, the guid? field is updated to hold the id of the new manager. However, if I want to change the user back to having no manager, how can I set the field back to NULL?

Should I be using Guid instead of Guid? and write Guid.Empty to the DB instead?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T17:35:55+00:00Added an answer on June 7, 2026 at 5:35 pm

    Should I be using Guid instead of Guid? and write Guid.Empty to the DB instead?

    Not really. You could do that, but you wouldn’t really gain much. Semantically, if there is “no” value for a field, NULL is the correct value. What you are talking about is using a magic value.

    how can I set the field back to NULL?

    Set the Guid? to null on your POCO. For example, if your POCO looks something like this:

    public class Poco
    {
        public Guid? Manager { get; set; }
    }
    

    Set it to null like this:

    somepocoinstance.Manager = null;
    

    Then commit the changes.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a SOLR database that needs to have a new field containing a
I have a Datatable with Id(guid) and Name(string) columns. I traverse through the data
I have a Users table where the ID field is a GUID field. Using
i have a guid value that i store in my hidden variable. say for
I have a class (built by EF from my database) that has a field
I have this schema: mysql> describe suggested_solution_comments; +-----------------------+----------------+------+-----+---------+----------------+ | Field | Type | Null
I have a table that has a field of type uniqueidentifier which is going
I have a call that needs to determine if a field has changed. But
I have a range of objects that have a long field whose value uniquely
I have a GUID variable and I want to write inside a text file

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.