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 8333489
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T03:02:58+00:00 2026-06-09T03:02:58+00:00

If some field or submessage in IMessage has IsOptional property set o true, how

  • 0

If some field or submessage in IMessage has IsOptional property set o true, how to check if it was specified or not?

pbMsg.DescriptorForType.FindFieldByName("some_field_name").IsOptional == true

Cause if it is not, then accessing it or its subfields (or submessages) causes an exception.

  • 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-09T03:03:02+00:00Added an answer on June 9, 2026 at 3:03 am

    Use pbMsg.HasField(...). Here’s what the Object Browser documentation from IMessage.HasField(...) says about this method:

    Returns true if the given field is set. This is exactly equivalent to calling the generated “Has” property corresponding to the field.

    Please note that this is using the protobuf-csharp library.

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

Sidebar

Related Questions

I have a Java class which has some field annotated with @SearchCriteria(criteria = class1.class2.field)
I have a hibernate pojo class and it has some field. Assume that there
I have a java class, for some field (not all field), I will put
I am storing and editing some field in a database that involves a long
I want to perform a sort operation on some field. Is it advantageous making
I'm using a JTabbedPane and want to do some field validation at the moment
class A(models.Model): def calculate(self): # calculate some field based on all self.b_set instances class
When creating a view and setting group by value some field, it groups only
I want to parse xml file in utf-8 and sort it by some field.
Can I get the value of an object field some other way than obj.field

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.