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)

贡献者指南