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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T02:40:26+00:00 2026-05-20T02:40:26+00:00

I am evaluating resharper and I noticed a quirk in the software. I am

  • 0

I am evaluating resharper and I noticed a quirk in the software. I am not sure if this is truly a quirk.
Here’s my code:

var oc = new OracleConnection();

Resharper is suggesting using an Object Initializer for this instead of new keyword. How do you use an object initializer for a connection? Any ideas?

  • 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-05-20T02:40:26+00:00Added an answer on May 20, 2026 at 2:40 am

    Why don’t you click on the suggestion and Resharper will do the correction for you?

    I guess the code you have is something like:

    var oc = new OracleConnection();    
    oc.Blabla = blabla;
    

    And what Resharper will do if you let it, is:

    var oc = new OracleConnection { Blabla = blabla };
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am recrusively evaluating properties via reflection using object.GetType().GetProperty(string propertyName). This is working fine
I have begun evaluating MonoDroid. (I've built many apps using Android+Eclipse) I created new-from-template
I'm evaluating whether or not certain variables match expected values. The variables are set
I'm evaluating several Comet servers because I need HTTP Push in a new project
I have just started evaluating whether or not I should be using OData influenced
I'm evaluating some underdocumented software. When I build a sample project, I'm getting a
When evaluating the following code in Emacs, I get (2 3) as the final
I am evaluating EF for my next new apps. How can I globally change
While evaluating the advantages and disadvantages of moving our Subversion-based repository over to Git,
When evaluating dojo.require statements, dojo tracks which modules and resources have been required and

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.