質問編集履歴

6

修正

2021/11/23 03:06

投稿

yo_si
yo_si

score12

test CHANGED
File without changes
test CHANGED
@@ -24,15 +24,7 @@
24
24
 
25
25
 
26
26
 
27
- O/Rマッパー
27
+
28
-
29
- Dapper
30
-
31
-
32
-
33
- DIコンテナ
34
-
35
- Autofac
36
28
 
37
29
  ### 発生している問題・エラーメッセージ
38
30
 

5

修正

2021/11/23 03:06

投稿

yo_si
yo_si

score12

test CHANGED
File without changes
test CHANGED
@@ -30,6 +30,10 @@
30
30
 
31
31
 
32
32
 
33
+ DIコンテナ
34
+
35
+ Autofac
36
+
33
37
  ### 発生している問題・エラーメッセージ
34
38
 
35
39
  CS1061

4

修正

2021/11/23 02:03

投稿

yo_si
yo_si

score12

test CHANGED
File without changes
test CHANGED
@@ -24,6 +24,12 @@
24
24
 
25
25
 
26
26
 
27
+ O/Rマッパー
28
+
29
+ Dapper
30
+
31
+
32
+
27
33
  ### 発生している問題・エラーメッセージ
28
34
 
29
35
  CS1061

3

修正

2021/11/23 01:43

投稿

yo_si
yo_si

score12

test CHANGED
File without changes
test CHANGED
@@ -162,13 +162,13 @@
162
162
 
163
163
  ```C#
164
164
 
165
- public class KanrihyouViewModel
165
+ public class LargeViewModel
166
-
166
+
167
- {
167
+ {
168
-
169
-
170
-
168
+
169
+
170
+
171
- public KanrihyouViewModel()
171
+ public LargeViewModel()
172
172
 
173
173
  {
174
174
 

2

Model定義、開発環境情報追加

2021/11/23 01:31

投稿

yo_si
yo_si

score12

test CHANGED
File without changes
test CHANGED
@@ -10,6 +10,20 @@
10
10
 
11
11
  ご教授ねがいます!!
12
12
 
13
+
14
+
15
+ 環境
16
+
17
+ ASP.NET MVC
18
+
19
+ OS Windows10
20
+
21
+ Visual Studio のバージョン Microsoft Visual Studio Community 2019 Version16.11.3
22
+
23
+ .NET Framework 4.8
24
+
25
+
26
+
13
27
  ### 発生している問題・エラーメッセージ
14
28
 
15
29
  CS1061
@@ -130,11 +144,11 @@
130
144
 
131
145
  {
132
146
 
133
- new UserViewModel() { UserId = 0, UserName = "あ", Count = 10},
147
+ new UserViewModel() { UserId = 0, UserName = "あ", TestFlg = 1},
134
-
148
+
135
- new UserViewModel() { UserId = 100, UserName = "い", Count = 20 },
149
+ new UserViewModel() { UserId = 100, UserName = "い", TestFlg = 2 },
136
-
150
+
137
- new UserViewModel() { UserId = 200, UserName = "う", Count = 30 },
151
+ new UserViewModel() { UserId = 200, UserName = "う", TestFlg = 3 },
138
152
 
139
153
 
140
154
 
@@ -144,6 +158,128 @@
144
158
 
145
159
 
146
160
 
161
+ LargeViewModel
162
+
163
+ ```C#
164
+
165
+ public class KanrihyouViewModel
166
+
167
+ {
168
+
169
+
170
+
171
+ public KanrihyouViewModel()
172
+
173
+ {
174
+
175
+
176
+
177
+ }
178
+
179
+ public IEnumerable<SelectListItem> AList { get; set; }
180
+
181
+
182
+
183
+ public IEnumerable<SelectListItem> BList { get; set; }
184
+
185
+
186
+
187
+ public IEnumerable<SelectListItem> CList { get; set; }
188
+
189
+
190
+
191
+ public IEnumerable<UserViewModel> IchiranTable { get; set; }
192
+
193
+
194
+
195
+ public string a { get; set; }
196
+
197
+
198
+
199
+ public string b { get; set; }
200
+
201
+
202
+
203
+ public string c { get; set; }
204
+
205
+ }
206
+
207
+ ```
208
+
209
+
210
+
211
+ UserViewModel
212
+
213
+ ```C#
214
+
215
+ public class UserViewModel
216
+
217
+ {
218
+
219
+ public UserViewModel()
220
+
221
+ {
222
+
223
+
224
+
225
+ }
226
+
227
+ public UserViewModel(UserViewModel x)
228
+
229
+ {
230
+
231
+ UserId = x.UserId;
232
+
233
+ UserName = x.UserName;
234
+
235
+ TestFlg = x.TestFlg;
236
+
237
+ IsInstalled = (x.TestFlg == (int)TestType.Installed);
238
+
239
+ }
240
+
241
+ public int UserId { get; set; }
242
+
243
+
244
+
245
+ public string UserName { get; set; }
246
+
247
+
248
+
249
+ public int TestFlg { get; set; }
250
+
251
+
252
+
253
+ public bool IsInstalled { get; set; }
254
+
255
+
256
+
257
+ }
258
+
259
+
260
+
261
+ public enum TestType
262
+
263
+ {
264
+
265
+ Test = 9,
266
+
267
+ Test1 = 1,
268
+
269
+ Test2 = 2,
270
+
271
+ Installed = 3,
272
+
273
+ Test3 = 4,
274
+
275
+ Test4 = 0
276
+
277
+ }
278
+
279
+ ```
280
+
281
+
282
+
147
283
  ### 試したこと
148
284
 
149
285
 

1

テスト用のDB

2021/11/23 01:30

投稿

yo_si
yo_si

score12

test CHANGED
File without changes
test CHANGED
@@ -80,7 +80,7 @@
80
80
 
81
81
  {
82
82
 
83
- LargeController controller = new LargeController(new DataTest());
83
+ LargeController controller = new LargeController(new DBTest());
84
84
 
85
85
 
86
86
 
@@ -118,6 +118,32 @@
118
118
 
119
119
 
120
120
 
121
+ DBTest
122
+
123
+ ```C#
124
+
125
+ public IEnumerable<UserViewModel> GetAllClients(string Param1, string Param2, string Param3, MySqlConnection conn)
126
+
127
+ {
128
+
129
+ return new UserViewModel[]
130
+
131
+ {
132
+
133
+ new UserViewModel() { UserId = 0, UserName = "あ", Count = 10},
134
+
135
+ new UserViewModel() { UserId = 100, UserName = "い", Count = 20 },
136
+
137
+ new UserViewModel() { UserId = 200, UserName = "う", Count = 30 },
138
+
139
+
140
+
141
+ }
142
+
143
+ ```
144
+
145
+
146
+
121
147
  ### 試したこと
122
148
 
123
149