Exemplo n.º 1
0
 private async Task <Dictionary <string, TLocalized> > Load <TLocalized, TEntity>([NotNull] string culture)
     where TLocalized : class, ILocalizedIdentity <TEntity>
     where TEntity : IIdentity
 {
     using (var context = new LocalizationContext())
         return(await context.Set <TLocalized>().Where(localized => localized.CultureKey == culture)
                .ToDictionaryAsync(localized => localized.StringKey).ConfigureAwait(false));
 }
Exemplo n.º 2
0
 private async Task <TLocalized> Load <TLocalized, TEntity>([NotNull] string key, [NotNull] string culture)
     where TLocalized : class, ILocalizedIdentity <TEntity>
     where TEntity : IIdentity
 {
     using (var context = new LocalizationContext())
         return(await context.Set <TLocalized>()
                .SingleOrDefaultAsync(localized => localized.StringKey == key && localized.CultureKey == culture)
                .ConfigureAwait(false));
 }
Exemplo n.º 3
0
        public virtual List <T> GetAll()
        {
            IQueryable <T> query = _context.Set <T>();

            return(query.ToList());
        }