dotnet/roslyn

Move Type to .cs file fails

Offen

#58.014 geöffnet am 29.11.2021

 (1 Kommentar) (0 Reaktionen) (1 zugewiesene Person)C# (4.257 Forks)batch import
Area-IDEBugDeveloper Communityhelp wanted

Repository-Metriken

Stars
 (20.414 Sterne)
PR-Merge-Metriken
 (Durchschn. Merge 6T 17h) (256 gemergte PRs in 30 T)

Beschreibung

This issue has been moved from a ticket on Developer Community.


Intellisense fails to remove the class created when I've selected the "Move type to .cs" option. It does create the new file, but does not remove the class from where I called the intellisense method.

    public class ProductGroup : IReadModel
    {
        public string? ProductGroupId { get; set; }

public string? Name { get; set; }
    }

public class ProductGroupValidator : IValidator<ProductGroup>
    {
        public bool IsValid(ProductGroup productGroup)
        {
            if (productGroup == null)
                throw new ValidationException($"ProductGroup received was null");

if (string. IsNullOrEmpty(productGroup.Name))
                throw new ValidationException($"ProductGroup Name is blank");

if (string. IsNullOrEmpty(productGroup.ProductGroupId))
                throw new ValidationException($"ProductGroup Id is blank");

return true;
        }
    }

In the file ProductGroup.cs, hover over the class ProductGroupValidator and select "Move type to ProductGroupValidator.cs" to replicate.


Original Comments

Feedback Bot on 11/16/2021, 02:07 AM:

Feedback Bot on 11/16/2021, 09:47 AM:

Andrew Hall 🤘 [MSFT] on 11/16/2021, 09:06 PM:

Pedro Dias on 11/23/2021, 07:31 PM:

Feedback Bot on 11/23/2021, 05:51 PM:

We will close this report in 14 days because we don’t have enough information to investigate further. To keep the problem open, please provide the requested details.


Original Solutions

(no solutions)

Contributor Guide