forked from anjoy8/Blog.Core
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFrameSeed.cs
More file actions
121 lines (99 loc) · 2.97 KB
/
FrameSeed.cs
File metadata and controls
121 lines (99 loc) · 2.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
using Blog.Core.Common;
using Blog.Core.Common.Helper;
using Blog.Core.Model.Models;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;
namespace Blog.Core.Model.Models
{
public class FrameSeed
{
/// <summary>
/// 生成Model层
/// </summary>
/// <param name="myContext"></param>
/// <returns></returns>
public static bool CreateModels(MyContext myContext)
{
try
{
myContext.Create_Model_ClassFileByDBTalbe($@"C:\my-file\Blog.Core.Model", "Blog.Core.Model.Models", new string[] { }, "");
return true;
}
catch (Exception)
{
return false;
}
}
/// <summary>
/// 生成IRepository层
/// </summary>
/// <param name="myContext"></param>
/// <returns></returns>
public static bool CreateIRepositorys(MyContext myContext)
{
try
{
myContext.Create_IRepository_ClassFileByDBTalbe($@"C:\my-file\Blog.Core.IRepository", "Blog.Core.IRepository", new string[] { }, "");
return true;
}
catch (Exception)
{
return false;
}
}
/// <summary>
/// 生成 IService 层
/// </summary>
/// <param name="myContext"></param>
/// <returns></returns>
public static bool CreateIServices(MyContext myContext)
{
try
{
myContext.Create_IServices_ClassFileByDBTalbe($@"C:\my-file\Blog.Core.IServices", "Blog.Core.IServices", new string[] { "Module" }, "");
return true;
}
catch (Exception)
{
return false;
}
}
/// <summary>
/// 生成 Repository 层
/// </summary>
/// <param name="myContext"></param>
/// <returns></returns>
public static bool CreateRepository(MyContext myContext)
{
try
{
myContext.Create_Repository_ClassFileByDBTalbe($@"C:\my-file\Blog.Core.Repository", "Blog.Core.Repository", new string[] { "Module" }, "");
return true;
}
catch (Exception)
{
return false;
}
}
/// <summary>
/// 生成 Service 层
/// </summary>
/// <param name="myContext"></param>
/// <returns></returns>
public static bool CreateServices(MyContext myContext)
{
try
{
myContext.Create_Services_ClassFileByDBTalbe($@"C:\my-file\Blog.Core.Services", "Blog.Core.Services", new string[] { "Module" }, "");
return true;
}
catch (Exception)
{
return false;
}
}
}
}