自己动手实现简易代码生成器、采用文本模板文件生成服务层、服务层接口代码的做法参考...
生活随笔
收集整理的這篇文章主要介紹了
自己动手实现简易代码生成器、采用文本模板文件生成服务层、服务层接口代码的做法参考...
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
為什么80%的碼農都做不了架構師?>>> ??
?? 最近受到 單程列車?http://www.cnblogs.com/zhaojingjing/? 的啟發,讓我做一個模板文件來生成代碼,效果會很好,我就接納了人家善意的提醒,周六晚上就改進了一下代碼生成器,折騰了一個多小時,一個簡易的按模板替換的代碼生成器功能實現好了,非常簡單好用,現在分享給大家。
?? 模板文件里用了 namespace #Company#.#Project#.Service, #?# 進行替換的思路,設置了文本模板文件,然后用代碼生成器進行后臺的代碼,方便高效一些,代碼質量也有保障一些。讀取文件的功能函數參考如下:
???????????? string ?file? = ?Application.StartupPath? + ? " \\Templates\\IService.txt " ;???????????? string ?code? = ?GetTemplate(file);
????????????code? = ?ReplaceTemplate(code);
???????????? this .txtCode.SettxtContent( " c# " ,?code); ???????? private ? string ?GetTemplate( string ?file)
????????{
???????????? string ?code? = ? string .Empty;
????????????FileStream?fileStream? = ? new ?FileStream(file,?FileMode.Open,?FileAccess.Read,?FileShare.ReadWrite);
???????????? using ?(StreamReader?streamReader? = ? new ?StreamReader(fileStream,?Encoding.Default))
????????????{
????????????????code? = ?streamReader.ReadToEnd();
????????????}
???????????? return ?code;
????????}
?
模板文件的替換參考如下:
???????? private ? string ?ReplaceTemplate( string ?code)????????{
????????????code? = ?code.Replace( " #Author# " ,? this .txtAuthor.Text);
????????????code? = ?code.Replace( " #ClassName# " ,? this .txtClassName.Text);
????????????code? = ?code.Replace( " #Code# " ,? this .txtCode.Text);
????????????code? = ?code.Replace( " #Company# " ,? this .txtCompany.Text);
????????????code? = ?code.Replace( " #DateCreated# " ,? this .txtDateCreated.Text);
????????????code? = ?code.Replace( " #Project# " ,? this .txtProject.Text);
????????????code? = ?code.Replace( " #YearCreated# " ,? this .txtYearCreated.Text);
???????????? return ?code;
????????}
程序的運行效果如下:
?
按模板生成的代碼主要功能部分是這2個按鈕:?
按模板替換的只要有以下2個模板文件,模板文件以文本的方式存了代碼文件。
?
服務程序接口模板文件的參考如下:?IService.txt
代碼 // ------------------------------------------------------------// ?All?Rights?Reserved?,?Copyright?(C)?#YearCreated#?,?#Company#?,?Ltd.?
// ------------------------------------------------------------
using ?System.Data;
using ?System.ServiceModel;
using ?System.Collections.Generic;
namespace ?#Company#.#Project#.IService
{
???? using ?DotNet.Model;
???? using ?DotNet.Utilities;
???? /// ? <summary>
???? /// ?I#ClassName#Service
???? /// ?服務層接口
???? /// ?
???? /// ?修改紀錄
???? /// ?
???? /// ????????#DateCreated#?版本:1.0?#Author#?創建文件。
???? /// ????????
???? /// ?版本:1.0
???? ///
???? /// ? <author>
???? /// ???????? <name> #Author# </name>
???? /// ???????? <date> #DateCreated# </date>
???? /// ? </author> ?
???? /// ? </summary>
????[ServiceContract]
???? public ? interface ?I#ClassName#Service
????{
???????? /// ? <summary>
???????? /// ?添加實體
???????? /// ? </summary>
???????? /// ? <param?name="userInfo"> 操作員 </param>
???????? /// ? <param?name="entity"> 實體 </param>
???????? /// ? <param?name="statusCode"> 返回狀態碼 </param>
???????? /// ? <param?name="statusMessage"> 返回狀態信息 </param>
???????? /// ? <returns> 主鍵 </returns>
????????[OperationContract]
???????? string ?Add(BaseUserInfo?userInfo,?#ClassName#Entity?entity,? out ? string ?statusCode,? out ? string ?statusMessage);
???????? /// ? <summary>
???????? /// ?獲取列表
???????? /// ? </summary>
???????? /// ? <param?name="userInfo"> 操作員 </param>
???????? /// ? <returns> 數據表 </returns>
????????[OperationContract]
????????DataTable?GetDT(BaseUserInfo?userInfo);
????????
???????? /// ? <summary>
???????? /// ?獲取實體
???????? /// ? </summary>
???????? /// ? <param?name="userInfo"> 操作員 </param>
???????? /// ? <param?name="id"> 主鍵 </param>
???????? /// ? <returns> 實體 </returns>
????????[OperationContract]
????????#ClassName#Entity?GetEntity(BaseUserInfo?userInfo,? string ?id);
????????
???????? /// ? <summary>
???????? /// ?編輯
???????? /// ? </summary>
???????? /// ? <param?name="userInfo"> 操作員 </param>
???????? /// ? <param?name="entity"> 實體 </param>
???????? /// ? <param?name="statusCode"> 返回狀態碼 </param>
???????? /// ? <param?name="statusMessage"> 返回狀態信息 </param>
???????? /// ? <returns> 影響行數 </returns>
????????[OperationContract]
???????? int ?Update(BaseUserInfo?userInfo,?#ClassName#Entity?entity,? out ? string ?statusCode,? out ? string ?statusMessage);
????????
???????? /// ? <summary>
???????? /// ?獲取數據列表
???????? /// ? </summary>
???????? /// ? <param?name="userInfo"> 操作員 </param>
???????? /// ? <param?name="ids"> 主鍵 </param>
???????? /// ? <returns> 數據表 </returns>
????????[OperationContract]
????????DataTable?GetDTByIds(BaseUserInfo?userInfo,? string []?ids);
????????????????
???????? /// ? <summary>
???????? /// ?批量保存
???????? /// ? </summary>
???????? /// ? <param?name="userInfo"> 操作員 </param>
???????? /// ? <param?name="entites"> 實體列表 </param>
???????? /// ? <returns> 影響行數 </returns>
????????[OperationContract]
???????? int ?BatchSave(BaseUserInfo?userInfo,?List < #ClassName#Entity > ?entites);
????????????????
???????? /// ? <summary>
???????? /// ?刪除
???????? /// ? </summary>
???????? /// ? <param?name="userInfo"> 操作員 </param>
???????? /// ? <param?name="id"> 主鍵 </param>
???????? /// ? <returns> 數據表 </returns>
????????[OperationContract]
???????? int ?Delete(BaseUserInfo?userInfo,? string ?id);
????????
???????? /// ? <summary>
???????? /// ?批量刪除
???????? /// ? </summary>
???????? /// ? <param?name="userInfo"> 操作員 </param>
???????? /// ? <param?name="ids"> 主鍵數組 </param>
???????? /// ? <returns> 影響行數 </returns>
????????[OperationContract]
???????? int ?BatchDelete(BaseUserInfo?userInfo,? string []?ids);
???????? /// ? <summary>
???????? /// ?批量做刪除標志
???????? /// ? </summary>
???????? /// ? <param?name="userInfo"> 用戶 </param>
???????? /// ? <param?name="ids"> 主鍵數組 </param>
???????? /// ? <returns> 影響行數 </returns>
????????[OperationContract]
???????? int ?SetDeleted(BaseUserInfo?userInfo,? string []?ids);
?????}
}
?
?
服務程序模板文件的參考如下:Service.txt
代碼 // ------------------------------------------------------------// ?All?Rights?Reserved?,?Copyright?(C)?#YearCreated#?,?#Company#?,?Ltd.?
// ------------------------------------------------------------
using ?System;
using ?System.Data;
using ?System.Collections.Generic;
using ?System.Reflection;
namespace ?#Company#.#Project#.Service
{
???? using ?DotNet.Business;
???? using ?DotNet.DbUtilities;
???? using ?DotNet.Model;
???? using ?DotNet.Utilities;
???? using ?DotNet.IService;
???? /// ? <summary>
???? /// ?#ClassName#Service
???? /// ?服務層
???? /// ?
???? /// ?修改紀錄
???? /// ?
???? /// ????????#DateCreated#?版本:1.0?#Author#?創建文件。
???? /// ????????
???? /// ?版本:1.0
???? ///
???? /// ? <author>
???? /// ???????? <name> #Author# </name>
???? /// ???????? <date> #DateCreated# </date>
???? /// ? </author> ?
???? /// ? </summary>
???? public ? class ?#ClassName#Service?:?System.MarshalByRefObject,?I#ClassName#Service
????{
???????? /// ? <summary>
???????? /// ?業務數據庫連接
???????? /// ? </summary>
???????? private ? readonly ? string ?BusinessDbConnection? = ?BaseSystemInfo.BusinessDbConnection;
???????? /// ? <summary>
???????? /// ?添加實體
???????? /// ? </summary>
???????? /// ? <param?name="userInfo"> 操作員 </param>
???????? /// ? <param?name="entity"> 實體 </param>
???????? /// ? <param?name="statusCode"> 返回狀態碼 </param>
???????? /// ? <param?name="statusMessage"> 返回狀態信息 </param>
???????? /// ? <returns> 主鍵 </returns>
???????? public ? string ?Add(BaseUserInfo?userInfo,?#ClassName#Entity?entity,? out ? string ?statusCode,? out ? string ?statusMessage)
????????{
???????????? // ?寫入調試信息
???????????? #if ?(DEBUG)
???????????????? int ?milliStart? = ?BaseBusinessLogic.StartDebug(userInfo,?MethodBase.GetCurrentMethod());
???????????? #endif
???????????? string ?returnValue? = ? string .Empty;
????????????IDbHelper?dbHelper? = ?DbHelperFactory.GetHelper();
???????????? try
????????????{
????????????????dbHelper.Open(BusinessDbConnection);
????????????????#ClassName#Manager?manager? = ? new ?#ClassName#Manager(dbHelper,?userInfo);
????????????????returnValue? = ?manager.AddEntity(entity);
???????????????? // ?returnValue?=?manager.Add(entity,?out?statusCode);
????????????????statusMessage? = ?manager.GetStateMessage(statusCode);
????????????????BaseLogManager.Instance.Add(dbHelper,?userInfo,?MethodBase.GetCurrentMethod());
????????????}
???????????? catch ?(Exception?ex)
????????????{
????????????????BaseExceptionManager.LogException(dbHelper,?userInfo,?ex);
???????????????? throw ?ex;
????????????}
???????????? finally
????????????{
????????????????dbHelper.Close();
????????????}
???????????? // ?寫入調試信息
???????????? #if ?(DEBUG)
????????????????BaseBusinessLogic.EndDebug(MethodBase.GetCurrentMethod(),?milliStart);
???????????? #endif
????????????
???????????? return ?returnValue;
????????}
???????? /// ? <summary>
???????? /// ?獲取列表
???????? /// ? </summary>
???????? /// ? <param?name="userInfo"> 操作員 </param>
???????? /// ? <returns> 數據表 </returns>
???????? public ?DataTable?GetDT(BaseUserInfo?userInfo)
????????{
???????????? // ?寫入調試信息
???????????? #if ?(DEBUG)
???????????????? int ?milliStart? = ?BaseBusinessLogic.StartDebug(userInfo,?MethodBase.GetCurrentMethod());
???????????? #endif
????????????DataTable?dataTable? = ? new ?DataTable(#ClassName#Table.TableName);
????????????IDbHelper?dbHelper? = ?DbHelperFactory.GetHelper();
???????????? try
????????????{
????????????????dbHelper.Open(BusinessDbConnection);
???????????????? // ?獲得列表
????????????????#ClassName#Manager?manager? = ? new ?#ClassName#Manager(dbHelper,?userInfo);
????????????????dataTable? = ?manager.GetDT(#ClassName#Table.FieldDeletionStateCode,? 0 ,?#ClassName#Table.FieldSortCode);
????????????????dataTable.TableName? = ?#ClassName#Table.TableName;
????????????????BaseLogManager.Instance.Add(dbHelper,?userInfo,?MethodBase.GetCurrentMethod());
????????????}
???????????? catch ?(Exception?ex)
????????????{
????????????????BaseExceptionManager.LogException(dbHelper,?userInfo,?ex);
???????????????? throw ?ex;
????????????}
???????????? finally
????????????{
????????????????dbHelper.Close();
????????????}
???????????? // ?寫入調試信息
???????????? #if ?(DEBUG)
????????????????BaseBusinessLogic.EndDebug(MethodBase.GetCurrentMethod(),?milliStart);
???????????? #endif
???????????? return ?dataTable;
????????}
???????? /// ? <summary>
???????? /// ?獲取實體
???????? /// ? </summary>
???????? /// ? <param?name="userInfo"> 操作員 </param>
???????? /// ? <param?name="id"> 主鍵 </param>
???????? /// ? <returns> 實體 </returns>
???????? public ?#ClassName#Entity?GetEntity(BaseUserInfo?userInfo,? string ?id)
????????{
???????????? // ?寫入調試信息
???????????? #if ?(DEBUG)
???????????????? int ?milliStart? = ?BaseBusinessLogic.StartDebug(userInfo,?MethodBase.GetCurrentMethod());
???????????? #endif
????????????#ClassName#Entity?entity? = ? null ;
????????????IDbHelper?dbHelper? = ?DbHelperFactory.GetHelper();
???????????? try
????????????{
????????????????dbHelper.Open(BusinessDbConnection);
????????????????#ClassName#Manager?manager? = ? new ?#ClassName#Manager(dbHelper,?userInfo);
????????????????entity? = ?manager.GetEntity(id);
????????????????BaseLogManager.Instance.Add(dbHelper,?userInfo,?MethodBase.GetCurrentMethod());
????????????}
???????????? catch ?(Exception?ex)
????????????{
????????????????BaseExceptionManager.LogException(dbHelper,?userInfo,?ex);
???????????????? throw ?ex;
????????????}
???????????? finally
????????????{
????????????????dbHelper.Close();
????????????}
???????????? // ?寫入調試信息
???????????? #if ?(DEBUG)
????????????????BaseBusinessLogic.EndDebug(MethodBase.GetCurrentMethod(),?milliStart);
???????????? #endif
???????????? return ?entity;
????????}
???????? /// ? <summary>
???????? /// ?編輯
???????? /// ? </summary>
???????? /// ? <param?name="userInfo"> 操作員 </param>
???????? /// ? <param?name="entity"> 實體 </param>
???????? /// ? <param?name="statusCode"> 返回狀態碼 </param>
???????? /// ? <param?name="statusMessage"> 返回狀態信息 </param>
???????? /// ? <returns> 影響行數 </returns>
???????? public ? int ?Update(BaseUserInfo?userInfo,?#ClassName#Entity?entity,? out ? string ?statusCode,? out ? string ?statusMessage)
????????{
???????????? // ?寫入調試信息
???????????? #if ?(DEBUG)
???????????????? int ?milliStart? = ?BaseBusinessLogic.StartDebug(userInfo,?MethodBase.GetCurrentMethod());
???????????? #endif
???????????? int ?returnValue? = ? 0 ;
????????????IDbHelper?dbHelper? = ?DbHelperFactory.GetHelper();
???????????? try
????????????{
????????????????dbHelper.Open(BusinessDbConnection);
????????????????#ClassName#Manager?manager? = ? new ?#ClassName#Manager(dbHelper,?userInfo);
????????????????returnValue? = ?manager.UpdateEntity(entity);
???????????????? // ?returnValue?=?manager.Update(entity,?out?statusCode);
????????????????statusMessage? = ?manager.GetStateMessage(statusCode);
????????????????BaseLogManager.Instance.Add(dbHelper,?userInfo,?MethodBase.GetCurrentMethod());
????????????}
???????????? catch ?(Exception?ex)
????????????{
????????????????BaseExceptionManager.LogException(dbHelper,?userInfo,?ex);
???????????????? throw ?ex;
????????????}
???????????? finally
????????????{
????????????????dbHelper.Close();
????????????}
???????????? // ?寫入調試信息
???????????? #if ?(DEBUG)
????????????????BaseBusinessLogic.EndDebug(MethodBase.GetCurrentMethod(),?milliStart);
???????????? #endif
???????????? return ?returnValue;
????????}
???????? /// ? <summary>
???????? /// ?獲取數據列表
???????? /// ? </summary>
???????? /// ? <param?name="userInfo"> 操作員 </param>
???????? /// ? <param?name="ids"> 主鍵 </param>
???????? /// ? <returns> 數據表 </returns>
???????? public ?DataTable?GetDTByIds(BaseUserInfo?userInfo,? string []?ids)
????????{
???????????? // ?寫入調試信息
???????????? #if ?(DEBUG)
???????????????? int ?milliStart? = ?BaseBusinessLogic.StartDebug(userInfo,?MethodBase.GetCurrentMethod());
???????????? #endif
????????????DataTable?dataTable? = ? new ?DataTable(#ClassName#Table.TableName);
????????????IDbHelper?dbHelper? = ?DbHelperFactory.GetHelper();
???????????? try
????????????{
????????????????dbHelper.Open(BusinessDbConnection);
????????????????#ClassName#Manager?manager? = ? new ?#ClassName#Manager(dbHelper,?userInfo);
????????????????dataTable? = ?manager.GetDT(#ClassName#Table.FieldId,?ids,?#ClassName#Table.FieldSortCode);
????????????????dataTable.TableName? = ?#ClassName#Table.TableName;
????????????????BaseLogManager.Instance.Add(dbHelper,?userInfo,?MethodBase.GetCurrentMethod());
????????????}
???????????? catch ?(Exception?ex)
????????????{
????????????????BaseExceptionManager.LogException(dbHelper,?userInfo,?ex);
???????????????? throw ?ex;
????????????}
???????????? finally
????????????{
????????????????dbHelper.Close();
????????????}
???????????? // ?寫入調試信息
???????????? #if ?(DEBUG)
????????????????BaseBusinessLogic.EndDebug(MethodBase.GetCurrentMethod(),?milliStart);
???????????? #endif
???????????? return ?dataTable;
????????}
????????
???????? /// ? <summary>
???????? /// ?批量保存
???????? /// ? </summary>
???????? /// ? <param?name="userInfo"> 操作員 </param>
???????? /// ? <param?name="entites"> 實體列表 </param>
???????? /// ? <returns> 影響行數 </returns>
???????? public ? int ?BatchSave(BaseUserInfo?userInfo,?List < #ClassName#Entity > ?entites)
????????{
???????????? // ?寫入調試信息
???????????? #if ?(DEBUG)
???????????????? int ?milliStart? = ?BaseBusinessLogic.StartDebug(userInfo,?MethodBase.GetCurrentMethod());
???????????? #endif
???????????? int ?returnValue? = ? 0 ;
????????????IDbHelper?dbHelper? = ?DbHelperFactory.GetHelper();
???????????? try
????????????{
????????????????dbHelper.Open(BusinessDbConnection);
????????????????#ClassName#Manager?manager? = ? new ?#ClassName#Manager(dbHelper,?userInfo);
???????????????? // ?returnValue?=?manager.BatchSave(entites);
????????????????BaseLogManager.Instance.Add(dbHelper,?userInfo,?MethodBase.GetCurrentMethod());
????????????}
???????????? catch ?(Exception?ex)
????????????{
????????????????BaseExceptionManager.LogException(dbHelper,?userInfo,?ex);
???????????????? throw ?ex;
????????????}
???????????? finally
????????????{
????????????????dbHelper.Close();
????????????}
???????????? // ?寫入調試信息
???????????? #if ?(DEBUG)
????????????????BaseBusinessLogic.EndDebug(MethodBase.GetCurrentMethod(),?milliStart);
???????????? #endif
???????????? return ?returnValue;
????????}
????????
???????? /// ? <summary>
???????? /// ?刪除
???????? /// ? </summary>
???????? /// ? <param?name="userInfo"> 操作員 </param>
???????? /// ? <param?name="id"> 主鍵 </param>
???????? /// ? <returns> 數據表 </returns>
???????? public ? int ?Delete(BaseUserInfo?userInfo,? string ?id)
????????{
???????????? // ?寫入調試信息
???????????? #if ?(DEBUG)
???????????????? int ?milliStart? = ?BaseBusinessLogic.StartDebug(userInfo,?MethodBase.GetCurrentMethod());
???????????? #endif
???????????? int ?returnValue? = ? 0 ;
????????????IDbHelper?dbHelper? = ?DbHelperFactory.GetHelper();
???????????? try
????????????{
????????????????dbHelper.Open(BusinessDbConnection);
????????????????#ClassName#Manager?manager? = ? new ?#ClassName#Manager(dbHelper,?userInfo);
????????????????returnValue? = ?manager.Delete(id);
????????????????BaseLogManager.Instance.Add(dbHelper,?userInfo,?MethodBase.GetCurrentMethod());
????????????}
???????????? catch ?(Exception?ex)
????????????{
????????????????BaseExceptionManager.LogException(dbHelper,?userInfo,?ex);
???????????????? throw ?ex;
????????????}
???????????? finally
????????????{
????????????????dbHelper.Close();
????????????}
???????????? // ?寫入調試信息
???????????? #if ?(DEBUG)
????????????????BaseBusinessLogic.EndDebug(MethodBase.GetCurrentMethod(),?milliStart);
???????????? #endif
???????????? return ?returnValue;
????????}
????????
???????? /// ? <summary>
???????? /// ?批量刪除
???????? /// ? </summary>
???????? /// ? <param?name="userInfo"> 操作員 </param>
???????? /// ? <param?name="ids"> 主鍵數組 </param>
???????? /// ? <returns> 影響行數 </returns>
???????? public ? int ?BatchDelete(BaseUserInfo?userInfo,? string []?ids)
????????{
???????????? // ?寫入調試信息
???????????? #if ?(DEBUG)
???????????????? int ?milliStart? = ?BaseBusinessLogic.StartDebug(userInfo,?MethodBase.GetCurrentMethod());
???????????? #endif
???????????? int ?returnValue? = ? 0 ;
????????????IDbHelper?dbHelper? = ?DbHelperFactory.GetHelper();
???????????? try
????????????{
????????????????dbHelper.Open(BusinessDbConnection);
???????????????? // ?開始數據庫事務
????????????????dbHelper.BeginTransaction();
????????????????#ClassName#Manager?manager? = ? new ?#ClassName#Manager(dbHelper,?userInfo);
????????????????returnValue? = ?manager.BatchDelete(ids);
????????????????BaseLogManager.Instance.Add(dbHelper,?userInfo,?MethodBase.GetCurrentMethod());
???????????????? // ?遞交數據庫事務
????????????????dbHelper.CommitTransaction();
????????????}
???????????? catch ?(Exception?ex)
????????????{
???????????????? // ?撤銷數據庫事務
????????????????dbHelper.RollbackTransaction();
????????????????BaseExceptionManager.LogException(dbHelper,?userInfo,?ex);
???????????????? throw ?ex;
????????????}
???????????? finally
????????????{
????????????????dbHelper.Close();
????????????}
???????????? // ?寫入調試信息
???????????? #if ?(DEBUG)
????????????????BaseBusinessLogic.EndDebug(MethodBase.GetCurrentMethod(),?milliStart);
???????????? #endif
???????????? return ?returnValue;
????????}
???????? /// ? <summary>
???????? /// ?批量做刪除標志
???????? /// ? </summary>
???????? /// ? <param?name="userInfo"> 用戶 </param>
???????? /// ? <param?name="ids"> 主鍵數組 </param>
???????? /// ? <returns> 影響行數 </returns>
???????? public ? int ?SetDeleted(BaseUserInfo?userInfo,? string []?ids)
????????{
???????????? // ?寫入調試信息
???????????? #if ?(DEBUG)
???????????????? int ?milliStart? = ?BaseBusinessLogic.StartDebug(userInfo,?MethodBase.GetCurrentMethod());
???????????? #endif
???????????? int ?returnValue? = ? 0 ;
????????????IDbHelper?dbHelper? = ?DbHelperFactory.GetHelper();
???????????? try
????????????{
????????????????dbHelper.Open(BusinessDbConnection);
????????????????#ClassName#Manager?manager? = ? new ?#ClassName#Manager(dbHelper,?userInfo);
????????????????returnValue? = ?manager.SetDeleted(ids);
????????????????BaseLogManager.Instance.Add(dbHelper,?userInfo,?MethodBase.GetCurrentMethod());
????????????}
???????????? catch ?(Exception?ex)
????????????{
????????????????BaseExceptionManager.LogException(dbHelper,?userInfo,?ex);
???????????????? throw ?ex;
????????????}
???????????? finally
????????????{
????????????????dbHelper.Close();
????????????}
???????????? // ?寫入調試信息
???????????? #if ?(DEBUG)
????????????????BaseBusinessLogic.EndDebug(MethodBase.GetCurrentMethod(),?milliStart);
???????????? #endif
???????????? return ?returnValue;
????????}
????}
}
?
?
?
?
轉載于:https://my.oschina.net/iwenr/blog/227639
總結
以上是生活随笔為你收集整理的自己动手实现简易代码生成器、采用文本模板文件生成服务层、服务层接口代码的做法参考...的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: NSAutoReleasePool使用中
- 下一篇: Android 高级进阶之overdra