public static string GetNextNumber(PositivityModel dbModel, string SPname) { var param = new SqlParameter("@p", System.Data.SqlDbType.NVarChar); param.Direction = System.Data.ParameterDirection.Output; param.Size = 100; dbModel.Database.ExecuteSqlCommand("EXEC " + SPname + " @p output", param); return(param.Value.ToString()); }
protected PositivityModel InitiateDbContext() { PositivityModel dbModel = new PositivityModel(); //dbModel.Configuration.ProxyCreationEnabled = false; //dbModel.Configuration.LazyLoadingEnabled = true; //dbModel.Database.Log = s => Debug.WriteLine( s ); return(dbModel); }
protected IList <T> GetLookupCollection <T>() where T : class { try { PositivityModel dbModel = new PositivityModel(); return(dbModel.Set <T>().ToList()); } catch (Exception ex) { Debug.WriteLine(ex.ToString()); throw; } }