dotnet/roslyn

Move Type to .cs file fails

オープン

#58,014 opened on 2021/11/29

 (1 件のコメント) (0 件のリアクション) (1 人の担当者)C# (4,257 件のフォーク)batch import
Area-IDEBugDeveloper Communityhelp wanted

Repository metrics

Stars
 (20,414 個のスター)
PR merge metrics
 (平均マージ 6d 17h) (30d で 256 merged PRs)

説明

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)

コントリビューターガイド