資源簡介
代碼片段和文件信息
using?System;
using?System.Data.Entity;
using?System.Data.Entity.Core.objects;
using?System.Data.Entity.Infrastructure;
using?System.Reflection;
using?System.Text.Regularexpressions;
namespace?Models
{
????public?static?class?ContextExtensions
????{
????????public?static?string?GetTableName(this?DbContext?context?Type?tableType)
????????{
????????????MethodInfo?method?=?typeof(ContextExtensions).GetMethod(“GetTableName“?new?Type[]?{?typeof(DbContext)?})
????????????????.MakeGenericMethod(new?Type[]?{?tableType?});
????????????return?(string)method.Invoke(context?new?object[]?{?context?});
????????}
????????public?static?string?GetTableName(this?DbContext?context)?where?T?:?class
????????{
????????????objectContext?objectContext?=?((IobjectContextAdapter)contex
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????文件????????5799??2015-09-10?16:40??DBDesc
?????文件?????????468??2015-09-10?15:39??Student.cs
?????文件????????1865??2015-09-07?15:10??TypeExtensions.cs
?????目錄???????????0??2015-09-08?13:42??Migrations\
?????文件????????1150??2015-09-08?13:32??Migrations\Configuration.cs
?????文件????????1275??2015-09-07?15:18??ContextExtensions.cs
?????文件?????????495??2015-09-07?14:41??DBDesc
評論
共有 條評論