C# code

Hi, this is working in the VS2015, How to modify below code to 2012?  (job?.Id > 0)
var job = await c.CreateJob(42626, 52.24525033130513, -0.8287811279296875);
 (job?.Id > 0)

I tried using below
 (job.Id > 0)
But no results
Who is Participating?
lankapalaConnect With a Mentor Author Commented:
it's ok i solved the issue.
zephyr_hex (Megan)DeveloperCommented:
This has nothing to do with the version of Visual Studio.

We can't answer the question unless we know what c is, and what c.CreateJob does.
käµfm³d 👽Commented:
This has nothing to do with the version of Visual Studio.
Sure it does. He's using the null-conditional operator. This became available in VS 2015. The equivalent syntax would be:

(job != null && job.Id > 0)

Open in new window

Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

zephyr_hex (Megan)DeveloperCommented:
@käµfm³d 👽

Isn't that a dependency on C# (the language) and not VS (the IDE)?
käµfm³d 👽Commented:
Well, yes and no. MS often releases versions of the language in conjunction with the IDE. If a version of an IDE doesn't support the syntax, then it will not know how to treat it. Try using async/await in VS 2008 and you'll see what I mean : )
lankapalaAuthor Commented:
I solved the issue
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.