0

我已经在 ReSharper 7.0.1 中设置了这个文件模板

using System;
using System.Collections.Generic;
using System.Linq;
using MyProject.Infrastructure.Messaging;

namespace $NAMESPACE$
{
    public class $CLASS$Command : ICommand<$CLASS$Command.Result>
    {
        $END$

        public class Result
        {

        }
    }


    public class $CLASS$Handler : ICommandHandler<$CLASS$Command, $CLASS$Command.Result>
    {
        public $CLASS$Command.Result Process($CLASS$Command c)
        {

            var result = new $CLASS$Command.Result {};
            return result;
        }
    }
}

当我基于模板创建文件时,只有一些$CLASS$变量实例被正确填充。在$CLASS$in 中使用的情况下$CLASS$Command.Result$CLASS$将替换为字母a而不是预期值,就像这样。

using System;
using System.Collections.Generic;
using System.Linq;
using MyProject.Infrastructure.Messaging;

namespace MyProject.Domain.AnEntity.Commands
{
    public class Test2Command : ICommand<aCommand.Result>
    {


        public class Result
        {

        }
    }


    public class Test2Handler : ICommandHandler<Test2Command, aCommand.Result>
    {
        public aCommand.Result Process(Test2Command c)
        {

            var result = new aCommand.Result {};
            return result;
        }
    }
}

我看不出这不起作用的原因。有谁知道我在这里做错了什么?

4

2 回答 2

0

这显然是 ReSharper 某些版本中的一个错误,据我所知,目前正在排队等待修复。

http://youtrack.jetbrains.com/issue/RSRP-334501

于 2012-11-13T18:38:25.740 回答
0

尝试把$END$之前>

public class $CLASS$Command : ICommand<$CLASS$Command.Result$END$>

这对我来说是一种解决方法(R# 7.1.3)。

于 2013-06-18T11:45:57.270 回答