dotnet/roslyn

Move Type to .cs file fails

開放

#58,014 建立於 2021年11月29日

 (1 則留言) (0 個反應) (1 位負責人)C# (4,257 個分叉)batch import
Area-IDEBugDeveloper Communityhelp wanted

倉庫指標

星標
 (20,414 顆星)
PR 合併指標
 (平均合併 6天 17小時) (30 天內合併 256 個 PR)

描述

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)

貢獻者指南