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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T07:33:11+00:00 2026-05-20T07:33:11+00:00

I am attempting to search for using (var context = new $DataContext$()) where DataContext

  • 0

I am attempting to search for

using (var context = new $DataContext$())

where DataContext is any class that extends System.Data.Linq.DataContext using Resharpers ‘Search with Pattern’.

The pattern I’m using is:

using($type$ $var$ = new $type$($args$))
{
  $stmt$
}

enter image description here

This appears to return all using statements, eg using StreamWriter, using FileStream, things that clearly do not derive from System.Data.Linq.DataContext

How can you return only the types indicated?

I am using VS 2010 SP1 Beta and ReSharper 5.1 C# Edition build 5.1.1727.12

  • 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-20T07:33:11+00:00Added an answer on May 20, 2026 at 7:33 am

    I suggest you file it as a bug, because the following returns the expected results:

    $type$ $var$ = new $type$($args$);
    

    (Settings like you showed them).
    It returns only this line:

    var context2 = new DataContext("");
    

    But not this:

    var stream2 = new FileStream("", FileMode.CreateNew);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a search query that I'm inheriting and attempting to optimize. I am
I'm new to ASP.NET MVC and I'm creating an app that will search a
I'm attempting to construct a search query in MySQL using multiple arguments, and I
I'm attempting to create my own templates for the search pages using drupal 6.
I am attempting to run a program that will find a new value for
I currently am using a data structures similar to the following: public class Individual
I'm attempting to search for content between 2 whole words using a regular expression.
In attempting to run ./manage.py runserver or shell or any other command for that
Attempting to print out a list of values from 2 different variables that are
I am attempting to recover source from an assembly using Reg Gate's Reflector. The

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.