Ejemplo n.º 1
0
        public static async Task <IQueryable <T> > ExecuteStoredByNameAsync <T>(this DbcontextRepo contextOnTrack, string storedName, params object[] parameters) where T : new()
        {
            using (DbcontextRepo context = new DbcontextRepo())
            {
                await context.Database.OpenConnectionAsync();

                DbCommand cmd = context.Database.GetDbConnection().CreateCommand();
                cmd.CommandText = storedName;
                cmd.CommandType = System.Data.CommandType.StoredProcedure;
                if (parameters.Length > 0)
                {
                    cmd.Parameters.AddRange(parameters);
                }
                IQueryable <T> resultlist;
                using (var reader = await cmd.ExecuteReaderAsync())
                {
                    resultlist = reader.MapTolistAsyn <T>().AsQueryable();
                }
                return(resultlist);
            }
        }
Ejemplo n.º 2
0
 public productRepository(DbcontextRepo dbcontext) : base(dbcontext)
 {
 }
Ejemplo n.º 3
0
 public RepositoryManager(DbcontextRepo RepositoryContext) =>
Ejemplo n.º 4
0
 public RepositoryBase(DbcontextRepo _RepositoryContext)
 {
     RepositoryContext = _RepositoryContext;
 }