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

  • SEARCH
  • Home
  • 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 7183277
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T17:56:48+00:00 2026-05-28T17:56:48+00:00

I’ve searched around a bit for this and tried a few things and can’t

  • 0

I’ve searched around a bit for this and tried a few things and can’t get it to work without turning some stuff off that I want on.

Normally I let Resharper have its way with namespace optimizations. In a Service implementation that’s mapping DTO’s to Domain Model objects it’s a nice visual to create an alias for each. That way when it’s late and you’re sleep deprived seeing Dtos.Customer and DomainModel.Customer helps.

using DomainModel = MyProduct.Core.Domain.Model;
using Dtos = MyProduct.ServiceModel.Dtos;

When I run code cleanup it changes those to:

using DomainModel = MyProduct.Core.Domain.Model;
using Customer = MyProduct.Core.Domain.Model.Customer;

Does anyone do this or something similar and keep R# from whacking it?

  • 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-28T17:56:49+00:00Added an answer on May 28, 2026 at 5:56 pm

    This is something ReSharper will do when you let it: shorten references, on code cleanup.

    Even though this behavior might be unwanted for you, it’s technically seen correct. Because in your code it’ll shorten something. And that’s what the algorithm is supposed to do.

    This is how the algorithm works that causes this result:

    1. Resharper finds a reference that can be made shorter (you’ve not given me enough code to exactly tell you where, but that doesn’t matter).
    2. After shortening it needs to assure that the object can be resolved, so it adds a new using for it (using Customer = MyProduct.Core.Domain.Model.Customer; in your case).
    3. Resharper detects that using Dtos = MyProduct.ServiceModel.Dtos; is no longer in use (after all, the other using covers your shortened reference). And removes it.

    This is what I suspect is causing this. I cannot be 100% certain without seeing the actual usages in code. But this is most likely the cause of the refactoring.

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

Sidebar

Related Questions

I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
Does anyone know how can I replace this 2 symbol below from the string
I have some data like this: 1 2 3 4 5 9 2 6
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a jquery bug and I've been looking for hours now, I can't
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.

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.