/// <summary> /// 生成 Repository 层 /// </summary> /// <param name="myContext"></param> /// <returns></returns> public static bool CreateServices(MyContext myContext) { try { myContext.Create_Repository_ClassFileByDBTalbe($@"C:\my-file\Blog.Core.Services", "Blog.Core.Services", new string[] { "Module" }, ""); return(true); } catch (Exception) { return(false); } }
/// <summary> /// 生成 Repository 层 /// </summary> /// <param name="myContext">上下文</param> /// <param name="tableNames">数据库表名数组,默认空,生成所有表</param> /// <returns></returns> public static bool CreateRepository(MyContext myContext, string[] tableNames = null) { try { myContext.Create_Repository_ClassFileByDBTalbe($@"C:\my-file\Blog.Core.Repository", "Blog.Core.Repository", tableNames, ""); return(true); } catch (Exception) { return(false); } }