【发布时间】:2018-01-20 10:47:23
【问题描述】:
Authorize.NET 提供了一个名为 ControllerTemplate.cst 的模板文件:
namespace AuthorizeNet.Api.Controllers
{
using System;
using AuthorizeNet.Api.Contracts.V1;
using AuthorizeNet.Api.Controllers.Bases;
#pragma warning disable 1591
public class APICONTROLLERNAMEController : ApiOperationBase<APICONTROLLERNAMERequest, APICONTROLLERNAMEResponse> {
public APICONTROLLERNAMEController(APICONTROLLERNAMERequest apiRequest) : base(apiRequest) {
}
override protected void ValidateRequest() {
var request = GetApiRequest();
//validate required fields
//if ( 0 == request.SearchType) throw new ArgumentException( "SearchType cannot be null");
//if ( null == request.Paging) throw new ArgumentException("Paging cannot be null");
//validate not-required fields
}
protected override void BeforeExecute()
{
var request = GetApiRequest();
RequestFactoryWithSpecified.APICONTROLLERNAMEType(request);
}
}
#pragma warning restore 1591
}
老实说,我从未使用过变换,我一直试图通过右键单击它来变换它,然后then running custom tool。
如何转换此模板并为项目中的每个控制器创建这些文件之一?
【问题讨论】:
标签: c# .net visual-studio visual-studio-2017 authorize.net