Beispiel #1
0
        protected BaseRepository(
            IUwaDbContext context,
            IMapper mapper)
        {
            var dbSet = context.GetType().GetProperties()
                        .FirstOrDefault(f => f.GetType()
                                        .GetGenericArguments().All(t => t == typeof(TEntity)));

            DbSet   = dbSet?.GetValue(context) as DbSet <TEntity>;
            Context = context;
            Mapper  = mapper;
        }
Beispiel #2
0
 public UserRepository(
     IUwaDbContext context,
     IMapper mapper)
     : base(context, mapper)
 {
 }