RepositoryTemplate.ttinclude 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <#+
  2. // <copyright file="DalTemplate.tt" company="Yue@China">
  3. // Copyright © Yue. All Rights Reserved.
  4. // </copyright>
  5. public class RepositoryTemplate : CSharpTemplate
  6. {
  7. private T4ModelInfo _model;
  8. public RepositoryTemplate(T4ModelInfo model)
  9. {
  10. _model=model;
  11. }
  12. ///<summary>
  13. ///获取 生成的文件名,根据模型名定义
  14. ///</summary>
  15. public string FileName {get {return string.Format("{0}Repository.gen.cs",_model.Name);}}
  16. public override string TransformText()
  17. {
  18. #>
  19. //------------------------------------------------------------------------------
  20. // <auto-generated>
  21. // 此代码由工具生成。
  22. // 对此文件的更改可能会导致不正确的行为,并且如果
  23. // 重新生成代码,这些更改将会丢失。
  24. // 如存在本生成代码外的新需求,请在相同命名空间下创建同名分部类实现 <#= _model.Name #>Repository 分部方法。
  25. // </auto-generated>
  26. //
  27. // <copyright file="<#= _model.Name #>Repository.gen.cs">
  28. // Copyright(c)2013 YUECN.All rights reserved.
  29. // CLR版本: v0.8
  30. // 开发组织:IWB
  31. // 公司网站:www.iwbnet.com
  32. // 所属工程: YZXYH
  33. // 生成时间:<#= DateTime.Now.ToString("yyyy-MM-dd HH:mm") #>
  34. // </copyright>
  35. //------------------------------------------------------------------------------
  36. using YZXYH.Repository.Models;
  37. using YZXYH.Repository.Interface;
  38. namespace YZXYH.Repository
  39. {
  40. public partial class <#= _model.Name #>Repository:BaseRepository<<#= _model.Name #>>,I<#= _model.Name #>Repository
  41. {
  42. public <#= _model.Name #>Repository(Yzxyh2017Context context) : base(context)
  43. {
  44. }
  45. }
  46. }
  47. <#+
  48. return this.GenerationEnvironment.ToString();
  49. }
  50. }
  51. #>