输入banner图图片脚本导航/分类

EF中使用NextVal(oracle)

编写扩展方法

public static decimal GetNextVal(this System.Data.Entity.DbContext ctx, string seqName)

        {

            return ctx.Database.SqlQuery<decimal>(string.Format("SELECT {0}.NEXTVAL FROM DUAL", seqName)).First();

        }

        public static decimal GetNextVal<T>(this DbContext ctx, T enumValue) where T : struct, IComparable, IConvertible, IFormattable

        {

            return ctx.GetNextVal(enumValue.ToString());

        }

EF中使用NextVal(oracle)

标签: