PageRenderTime 69ms CodeModel.GetById 21ms app.highlight 42ms RepoModel.GetById 2ms app.codeStats 0ms

/Plugins/WebApi4.Components/WebApi4.Components/WebApiBaseClass.cs

http://github.com/kahanu/CondorXE
C# | 477 lines | 438 code | 29 blank | 10 comment | 0 complexity | 59f7c98ef321ed6fcaf28f92d975ab35 MD5 | raw file
  1using System;
  2using System.Linq;
  3using Condor.Core;
  4using Condor.Core.Interfaces;
  5using MyMeta;
  6
  7namespace WebApi4.Components
  8{
  9    /// <summary>
 10    /// This is a base class so render the WebApi4 controllers and base controller.
 11    /// This is used by both the WebApi4 stand-alone project, and can be used in
 12    /// an ASP.NET MVC 4 application that has WebApi4 capabilities.
 13    /// </summary>
 14    public class WebApiBaseClass : RenderBase, IRenderObject
 15    {
 16        #region ctors
 17
 18        private readonly RequestContext _context;
 19
 20        private readonly string _namespaceName;
 21
 22        /// <summary>
 23        /// A base class for rendering WebApi4 classes to any particular component.
 24        /// </summary>
 25        /// <param name="context">The RequestContext</param>
 26        /// <param name="namespaceName">The name of the component namespace passed in by the derived class, i.e., Services, UI, etc.</param>
 27        public WebApiBaseClass(RequestContext context, string namespaceName) : base(context.Zeus.Output)
 28        {
 29            this._namespaceName = namespaceName;
 30            this._context = context;
 31        }
 32
 33        #endregion
 34
 35        #region Interface Implementations
 36
 37        public void Render()
 38        {
 39            _context.Dialog.InitDialog(_script.Tables.Count);
 40            _context.FileList.Add("");
 41
 42            RenderUnityWebApiConfigurationClass();
 43            RenderBaseControllerClass();
 44
 45            _context.Dialog.InitDialog(_script.Tables.Count);
 46            _context.FileList.Add("");
 47            _context.FileList.Add("Generated WebApi4 Controller classes: ");
 48            foreach (string tableName in _script.Tables)
 49            {
 50                _context.Dialog.Display("Adding " + tableName + "Controller class");
 51                ITable table = _context.Database.Tables[tableName];
 52                RenderApiControllerClass(table);
 53            }
 54        }
 55
 56
 57        #endregion
 58
 59        #region Private Methods
 60
 61        private void RenderApiControllerClass(ITable table)
 62        {
 63            _hdrUtil.WriteClassHeader(_output);
 64            
 65            _output.autoTabLn("using System;");
 66            _output.autoTabLn("using System.Collections.Generic;");
 67            _output.autoTabLn("using System.Linq;");
 68            _output.autoTabLn("using System.Linq.Expressions;");
 69            _output.autoTabLn("");
 70            _output.autoTabLn("using " + _script.Settings.BusinessObjects.BusinessObjectsNamespace + ";");
 71            _output.autoTabLn("using " + _script.Settings.DataOptions.DataObjectsNamespace + ";");
 72            _output.autoTabLn("using " + _script.Settings.DataOptions.DataObjectsNamespace + ".Interfaces;");
 73            _output.autoTabLn("");
 74            _output.autoTabLn("namespace " + _namespaceName + ".Controllers");
 75            _output.autoTabLn("{");
 76            _output.tabLevel++;
 77            _output.autoTabLn("/// <summary>");
 78            _output.autoTabLn("/// This is the WebApi controller for the " + StringFormatter.CleanUpClassName(table.Name) + " entity.");
 79            _output.autoTabLn("/// </summary>");
 80            _output.autoTabLn("public class " + StringFormatter.CleanUpClassName(table.Name) + "Controller : BaseController<" + StringFormatter.CleanUpClassName(table.Name) + ">");
 81            _output.autoTabLn("{");
 82            _output.tabLevel++;
 83            _output.autoTabLn("#region ctors");
 84            _output.autoTabLn("private readonly I" + StringFormatter.CleanUpClassName(table.Name) + _script.Settings.DataOptions.ClassSuffix.Name + " _" + StringFormatter.CamelCasing(StringFormatter.CleanUpClassName(table.Name)) + _script.Settings.DataOptions.ClassSuffix.Name + ";");
 85            _output.autoTabLn("private readonly IUnitOfWork _unitOfWork;");
 86            _output.autoTabLn("");
 87            _output.autoTabLn("public " + StringFormatter.CleanUpClassName(table.Name) + "Controller(I" + StringFormatter.CleanUpClassName(table.Name) + _script.Settings.DataOptions.ClassSuffix.Name + " " + StringFormatter.CamelCasing(StringFormatter.CleanUpClassName(table.Name)) + _script.Settings.DataOptions.ClassSuffix.Name + ", IUnitOfWork unitOfWork) : base(" + StringFormatter.CamelCasing(StringFormatter.CleanUpClassName(table.Name)) + _script.Settings.DataOptions.ClassSuffix.Name + ", unitOfWork)");
 88            _output.autoTabLn("{");
 89            _output.tabLevel++;
 90            _output.autoTabLn("this._unitOfWork = unitOfWork;");
 91            _output.autoTabLn("this._" + StringFormatter.CamelCasing(StringFormatter.CleanUpClassName(table.Name)) + _script.Settings.DataOptions.ClassSuffix.Name + " = " + StringFormatter.CamelCasing(StringFormatter.CleanUpClassName(table.Name)) + _script.Settings.DataOptions.ClassSuffix.Name + ";");
 92            _output.tabLevel--;
 93            _output.autoTabLn("}");
 94            _output.autoTabLn("");
 95            _output.autoTabLn("#endregion");
 96            _output.autoTabLn("");
 97            _output.autoTabLn("#region Custom Actions");
 98            _output.autoTabLn("");
 99            _output.autoTabLn("///// <summary>");
100            _output.autoTabLn("///// This is a custom action that returns Product by category.");
101            _output.autoTabLn("///// Check how the route is created in the RouteConfig.cs file in the App_Start folder.");
102            _output.autoTabLn("///// </summary>");
103            _output.autoTabLn("///// <param name=\"category\">Category Name</param>");
104            _output.autoTabLn("///// <returns></returns>");
105            _output.autoTabLn("//public List<Product> GetProductsByCategory(string category)");
106            _output.autoTabLn("//{");
107            _output.autoTabLn("//	Expression<Func<Product, bool>> exp = null;");
108            _output.autoTabLn("//	if (!string.IsNullOrEmpty(category))");
109            _output.autoTabLn("//		exp = c => c.Category.CategoryName.ToLower() == category.ToLower();");
110            _output.autoTabLn("");
111            _output.autoTabLn("//	return _productRepository.Get(exp).ToList();");
112            _output.autoTabLn("//}");
113            _output.autoTabLn("");
114            _output.autoTabLn("///// <summary>");
115            _output.autoTabLn("///// Get a Product by name.  Check the RouteConfig.cs file for routing.");
116            _output.autoTabLn("///// </summary>");
117            _output.autoTabLn("///// <param name=\"name\">Product Name</param>");
118            _output.autoTabLn("///// <returns></returns>");
119            _output.autoTabLn("//public Product GetProductByName(string name)");
120            _output.autoTabLn("//{");
121            _output.autoTabLn("");
122            _output.autoTabLn("//	Product product = _productRepository.Get(p => p.Name.ToLower() == name.ToLower()).SingleOrDefault();");
123            _output.autoTabLn("//	if (product == null)");
124            _output.autoTabLn("//		throw new HttpResponseException(Request.CreateResponse(HttpStatusCode.NotFound));");
125            _output.autoTabLn("");
126            _output.autoTabLn("//	return product;");
127            _output.autoTabLn("//}");
128            _output.autoTabLn("");
129            _output.autoTabLn("///// <summary>");
130            _output.autoTabLn("///// Calculate the tax for a product. (Example PUT method.)");
131            _output.autoTabLn("///// </summary>");
132            _output.autoTabLn("///// <param name=\"name\">Product model</param>");
133            _output.autoTabLn("///// <returns></returns>");
134            _output.autoTabLn("//[HttpPut]");
135            _output.autoTabLn("//public Product CalculateTax(Product model)");
136            _output.autoTabLn("//{");
137            _output.autoTabLn("//	if (ModelState.IsValid)");
138            _output.autoTabLn("//	{");
139            _output.autoTabLn("//		try");
140            _output.autoTabLn("//		{");
141            _output.autoTabLn("//			var tax = model.Amount * _taxRate;");
142            _output.autoTabLn("//			_groupDao.UpdateTax(tax);");
143            _output.autoTabLn("//			_unitOfWork.ActionEntities.Commit();");
144            _output.autoTabLn("//			");
145            _output.autoTabLn("//		}");
146            _output.autoTabLn("//		catch (Exception)");
147            _output.autoTabLn("//		{");
148            _output.autoTabLn("//			return Request.CreateResponse(HttpStatusCode.NotFound);");
149            _output.autoTabLn("//		}");
150            _output.autoTabLn("//		return Request.CreateResponse(HttpStatusCode.OK, model);");
151            _output.autoTabLn("//	}");
152            _output.autoTabLn("//	else");
153            _output.autoTabLn("//	{");
154            _output.autoTabLn("//		return Request.CreateResponse(HttpStatusCode.BadRequest);");
155            _output.autoTabLn("//	}");
156            _output.autoTabLn("//}");
157            _output.autoTabLn("");
158            _output.autoTabLn("#endregion");
159            _output.tabLevel--;
160            _output.autoTabLn("}");
161            _output.tabLevel--;
162            _output.autoTabLn("}");
163
164            _context.FileList.Add("    " + StringFormatter.CleanUpClassName(table.Name) + "Controller.cs");
165            SaveOutput(CreateFullPath(_namespaceName + "\\Controllers", StringFormatter.CleanUpClassName(table.Name) + "Controller.cs"), SaveActions.DontOverwrite);
166        }
167
168        private void RenderBaseControllerClass()
169        {
170            _hdrUtil.WriteClassHeader(_output);
171
172            _output.autoTabLn("using System;");
173            _output.autoTabLn("using System.Collections.Generic;");
174            _output.autoTabLn("using System.Linq;");
175            _output.autoTabLn("using System.Net;");
176            _output.autoTabLn("using System.Net.Http;");
177            _output.autoTabLn("using System.Web.Http;");
178            _output.autoTabLn("using " + _script.Settings.BusinessObjects.BusinessObjectsNamespace + ";");
179            _output.autoTabLn("using " + _script.Settings.DataOptions.DataObjectsNamespace + ";");
180            _output.autoTabLn("using " + _script.Settings.DataOptions.DataObjectsNamespace + ".Generated;");
181            _output.autoTabLn("");
182            _output.autoTabLn("namespace " + _namespaceName + ".Controllers");
183            _output.autoTabLn("{");
184            _output.tabLevel++;
185            _output.autoTabLn("/// <summary>");
186            _output.autoTabLn("/// This is the common base ApiController used for all controllers.");
187            _output.autoTabLn("/// </summary>");
188            _output.autoTabLn("/// <typeparam name=\"T\"></typeparam>");
189            _output.autoTabLn("public class BaseController<T> : ApiController where T : Entity");
190            _output.autoTabLn("{");
191            _output.tabLevel++;
192            _output.autoTabLn("#region ctors");
193            _output.autoTabLn("private readonly IRepository<T> _repository;");
194            _output.autoTabLn("private readonly IUnitOfWork _unitOfWork;");
195            _output.autoTabLn("");
196            _output.autoTabLn("public BaseController(IRepository<T> repository, IUnitOfWork unitOfWork)");
197            _output.autoTabLn("{");
198            _output.tabLevel++;
199            _output.autoTabLn("this._unitOfWork = unitOfWork;");
200            _output.autoTabLn("this._repository = repository;");
201            _output.tabLevel--;
202            _output.autoTabLn("}");
203            _output.autoTabLn("");
204            _output.autoTabLn("#endregion");
205            _output.autoTabLn("");
206            _output.autoTabLn("#region Basic CRUD");
207            _output.autoTabLn("");
208            _output.autoTabLn("/// <summary>");
209            _output.autoTabLn("/// Get all the entities in the repository.");
210            _output.autoTabLn("/// </summary>");
211            _output.autoTabLn("/// <returns></returns>");
212            _output.autoTabLn("public IEnumerable<T> Get()");
213            _output.autoTabLn("{");
214            _output.tabLevel++;
215            _output.autoTabLn("return _repository.Get();");
216            _output.tabLevel--;
217            _output.autoTabLn("}");
218            _output.autoTabLn("");
219            _output.autoTabLn("/// <summary>");
220            _output.autoTabLn("/// Get the selected entity.");
221            _output.autoTabLn("/// </summary>");
222            _output.autoTabLn("/// <param name=\"id\">Id</param>");
223            _output.autoTabLn("/// <returns></returns>");
224            _output.autoTabLn("public T Get(int id)");
225            _output.autoTabLn("{");
226            _output.tabLevel++;
227            _output.autoTabLn("T model = _repository.GetById(id);");
228            _output.autoTabLn("if (model == null)");
229            _output.tabLevel++;
230            _output.autoTabLn("throw new HttpResponseException(Request.CreateResponse(HttpStatusCode.NotFound));");
231            _output.tabLevel--;
232            _output.autoTabLn("");
233            _output.autoTabLn("return model;");
234            _output.tabLevel--;
235            _output.autoTabLn("}");
236            _output.autoTabLn("");
237            _output.autoTabLn("/// <summary>");
238            _output.autoTabLn("/// Insert a new model into the repository.");
239            _output.autoTabLn("/// </summary>");
240            _output.autoTabLn("/// <param name=\"model\">model</param>");
241            _output.autoTabLn("/// <returns></returns>");
242            _output.autoTabLn("public HttpResponseMessage Post(T model)");
243            _output.autoTabLn("{");
244            _output.tabLevel++;
245            _output.autoTabLn("if (ModelState.IsValid)");
246            _output.autoTabLn("{");
247            _output.tabLevel++;
248            _output.autoTabLn("_repository.Insert(model);");
249            _output.autoTabLn("_unitOfWork." + _script.Settings.DataOptions.DataContext.Name + ".Commit();");
250            _output.autoTabLn("");
251            _output.autoTabLn("var response = Request.CreateResponse(HttpStatusCode.Created, model);");
252            _output.autoTabLn("response.Headers.Location = new Uri(Url.Link(\"DefaultApi\", new { id = model.Id }));");
253            _output.autoTabLn("");
254            _output.autoTabLn("return response;");
255            _output.tabLevel--;
256            _output.autoTabLn("}");
257            _output.autoTabLn("else");
258            _output.autoTabLn("{");
259            _output.tabLevel++;
260            _output.autoTabLn("return Request.CreateResponse(HttpStatusCode.BadRequest);");
261            _output.tabLevel--;
262            _output.autoTabLn("}");
263            _output.tabLevel--;
264            _output.autoTabLn("}");
265            _output.autoTabLn("");
266            _output.autoTabLn("/// <summary>");
267            _output.autoTabLn("/// Update the selected model.");
268            _output.autoTabLn("/// </summary>");
269            _output.autoTabLn("/// <param name=\"model\">model</param>");
270            _output.autoTabLn("/// <returns></returns>");
271            _output.autoTabLn("public HttpResponseMessage Put(T model)");
272            _output.autoTabLn("{");
273            _output.tabLevel++;
274            _output.autoTabLn("if (ModelState.IsValid)");
275            _output.autoTabLn("{");
276            _output.tabLevel++;
277            _output.autoTabLn("try");
278            _output.autoTabLn("{");
279            _output.tabLevel++;
280            _output.autoTabLn("_repository.Update(model);");
281            _output.autoTabLn("_unitOfWork." + _script.Settings.DataOptions.DataContext.Name + ".Commit();");
282            _output.tabLevel--;
283            _output.autoTabLn("}");
284            _output.autoTabLn("catch (Exception)");
285            _output.autoTabLn("{");
286            _output.tabLevel++;
287            _output.autoTabLn("return Request.CreateResponse(HttpStatusCode.NotFound);");
288            _output.tabLevel--;
289            _output.autoTabLn("}");
290            _output.autoTabLn("return Request.CreateResponse(HttpStatusCode.OK, model);");
291            _output.tabLevel--;
292            _output.autoTabLn("}");
293            _output.autoTabLn("else");
294            _output.autoTabLn("{");
295            _output.tabLevel++;
296            _output.autoTabLn("return Request.CreateResponse(HttpStatusCode.BadRequest);");
297            _output.tabLevel--;
298            _output.autoTabLn("}");
299            _output.tabLevel--;
300            _output.autoTabLn("}");
301            _output.autoTabLn("");
302
303            _output.autoTabLn("/// <summary>");
304            _output.autoTabLn("/// Alternate generic Put method with an Id argument.");
305            _output.autoTabLn("/// </summary>");
306            _output.autoTabLn("/// <param name=\"id\"></param>");
307            _output.autoTabLn("/// <param name=\"model\"></param>");
308            _output.autoTabLn("/// <returns></returns>");
309            _output.autoTabLn("public HttpResponseMessage Put(int id, T model)");
310            _output.autoTabLn("{");
311            _output.tabLevel++;
312            _output.autoTabLn("if (ModelState.IsValid && id == model.Id)");
313            _output.autoTabLn("{");
314            _output.tabLevel++;
315            _output.autoTabLn("try");
316            _output.autoTabLn("{");
317            _output.tabLevel++;
318            _output.autoTabLn("_repository.Update(model);");
319            _output.autoTabLn("_unitOfWork." + _script.Settings.DataOptions.DataContext.Name + ".Commit();");
320            _output.tabLevel--;
321            _output.autoTabLn("}");
322            _output.autoTabLn("catch (Exception)");
323            _output.autoTabLn("{");
324            _output.tabLevel++;
325            _output.autoTabLn("return Request.CreateResponse(HttpStatusCode.NotFound);");
326            _output.tabLevel--;
327            _output.autoTabLn("}");
328            _output.autoTabLn("return Request.CreateResponse(HttpStatusCode.OK, model);");
329            _output.tabLevel--;
330            _output.autoTabLn("}");
331            _output.autoTabLn("else");
332            _output.autoTabLn("{");
333            _output.tabLevel++;
334            _output.autoTabLn("return Request.CreateResponse(HttpStatusCode.BadRequest);");
335            _output.tabLevel--;
336            _output.autoTabLn("}");
337            _output.tabLevel--;
338            _output.autoTabLn("}");
339
340
341
342            _output.autoTabLn("/// <summary>");
343            _output.autoTabLn("/// Delete the selected model by Id.");
344            _output.autoTabLn("/// </summary>");
345            _output.autoTabLn("/// <param name=\"id\">Id</param>");
346            _output.autoTabLn("/// <returns></returns>");
347            _output.autoTabLn("public HttpResponseMessage Delete(int id)");
348            _output.autoTabLn("{");
349            _output.tabLevel++;
350            _output.autoTabLn("T model = _repository.GetById(id);");
351            _output.autoTabLn("return Delete(model);");
352            _output.tabLevel--;
353            _output.autoTabLn("}");
354            _output.autoTabLn("");
355            _output.autoTabLn("/// <summary>");
356            _output.autoTabLn("/// Delete the selected model via the model.");
357            _output.autoTabLn("/// </summary>");
358            _output.autoTabLn("/// <param name=\"model\"></param>");
359            _output.autoTabLn("/// <returns></returns>");
360            _output.autoTabLn("public HttpResponseMessage Delete(T model)");
361            _output.autoTabLn("{");
362            _output.tabLevel++;
363            _output.autoTabLn("T localModel = _repository.GetById(model.Id);");
364            _output.autoTabLn("if (localModel == null)");
365            _output.autoTabLn("{");
366            _output.tabLevel++;
367            _output.autoTabLn("return Request.CreateResponse(HttpStatusCode.NotFound);");
368            _output.tabLevel--;
369            _output.autoTabLn("}");
370            _output.autoTabLn("");
371            _output.autoTabLn("try");
372            _output.autoTabLn("{");
373            _output.tabLevel++;
374            _output.autoTabLn("_repository.Delete(localModel);");
375            _output.autoTabLn("_unitOfWork." + _script.Settings.DataOptions.DataContext.Name + ".Commit();");
376            _output.tabLevel--;
377            _output.autoTabLn("}");
378            _output.autoTabLn("catch (Exception)");
379            _output.autoTabLn("{");
380            _output.tabLevel++;
381            _output.autoTabLn("return Request.CreateResponse(HttpStatusCode.NotFound);");
382            _output.tabLevel--;
383            _output.autoTabLn("}");
384            _output.autoTabLn("");
385            _output.autoTabLn("return Request.CreateResponse(HttpStatusCode.OK, localModel);");
386            _output.tabLevel--;
387            _output.autoTabLn("}");
388
389            _output.autoTabLn("#endregion");
390            _output.autoTabLn("");
391            _output.tabLevel--;
392            _output.autoTabLn("}");
393            _output.tabLevel--;
394            _output.autoTabLn("}");
395
396            _context.FileList.Add("    BaseController.cs");
397            SaveOutput(CreateFullPath(_namespaceName + "\\Controllers", "BaseController.cs"), SaveActions.Overwrite);
398        }
399
400        private void RenderUnityWebApiConfigurationClass()
401        {
402            _hdrUtil.WriteClassHeader(_output);
403
404            _output.autoTabLn("[assembly: WebActivator.PreApplicationStartMethod(typeof(" + _namespaceName + ".App_Start.UnityWebApi), \"Start\")]");
405            _output.autoTabLn("[assembly: WebActivator.ApplicationShutdownMethodAttribute(typeof(" + _namespaceName + ".App_Start.UnityWebApi), \"Stop\")]");
406            _output.autoTabLn("");
407            _output.autoTabLn("");
408            _output.autoTabLn("namespace " + _namespaceName + ".App_Start");
409            _output.autoTabLn("{");
410            _output.tabLevel++;
411            _output.autoTabLn("using System;");
412            _output.autoTabLn("using System.Linq;");
413            _output.autoTabLn("using System.Web.Http;");
414            _output.autoTabLn("using " + _script.Settings.DataOptions.DataObjectsNamespace + ";");
415            _output.autoTabLn("using " + _script.Settings.DataOptions.DataObjectsNamespace + ".Interfaces;");
416            _output.autoTabLn("using " + _script.Settings.DataOptions.DataObjectsNamespace + ".Repositories;");
417            _output.autoTabLn("using Microsoft.Practices.Unity;");
418            _output.autoTabLn("");
419            _output.autoTabLn("public static class UnityWebApi");
420            _output.autoTabLn("{");
421            _output.tabLevel++;
422            _output.autoTabLn("private static IUnityContainer container;");
423            _output.autoTabLn("");
424            _output.autoTabLn("#region Public Methods");
425            _output.autoTabLn("public static void Start()");
426            _output.autoTabLn("{");
427            _output.tabLevel++;
428            _output.autoTabLn("Initialise();");
429            _output.tabLevel--;
430            _output.autoTabLn("}");
431            _output.autoTabLn("");
432            _output.autoTabLn("public static void Stop()");
433            _output.autoTabLn("{");
434            _output.autoTabLn("");
435            _output.autoTabLn("} ");
436            _output.autoTabLn("#endregion");
437            _output.autoTabLn("");
438            _output.autoTabLn("#region Private Methods");
439            _output.autoTabLn("private static void Initialise()");
440            _output.autoTabLn("{");
441            _output.tabLevel++;
442            _output.autoTabLn("container = BuildUnityContainer();");
443            _output.autoTabLn("");
444            _output.autoTabLn("GlobalConfiguration.Configuration.DependencyResolver = new Unity.WebApi.UnityDependencyResolver(container);");
445            _output.tabLevel--;
446            _output.autoTabLn("}");
447            _output.autoTabLn("");
448            _output.autoTabLn("private static IUnityContainer BuildUnityContainer()");
449            _output.autoTabLn("{");
450            _output.tabLevel++;
451            _output.autoTabLn("var container = new UnityContainer();");
452            _output.autoTabLn("");
453
454            foreach (string tableName in _script.Tables)
455            {
456                ITable table = _context.Database.Tables[tableName];
457                _output.autoTabLn("container.RegisterType<I" + StringFormatter.CleanUpClassName(table.Name) + _script.Settings.DataOptions.ClassSuffix.Name + ", " + StringFormatter.CleanUpClassName(table.Name) + _script.Settings.DataOptions.ClassSuffix.Name + ">();");
458            }
459            _output.autoTabLn("container.RegisterType<IUnitOfWork, UnitOfWork>(new HierarchicalLifetimeManager());");
460
461            _output.autoTabLn("");
462            _output.autoTabLn("return container;");
463            _output.tabLevel--;
464            _output.autoTabLn("} ");
465            _output.autoTabLn("#endregion");
466            _output.tabLevel--;
467            _output.autoTabLn("}");
468            _output.tabLevel--;
469            _output.autoTabLn("}");
470
471            _context.FileList.Add("    UnityWebApi.cs");
472            SaveOutput(CreateFullPath(_namespaceName + "\\App_Start", "UnityWebApi.cs"), SaveActions.Overwrite);
473        }
474
475        #endregion
476    }
477}