示例#1
0
        public async Task <IEnumerable <Library> > GetAllAsync()
        {
            var libraries = new List <Library>();

            Context.Strategy = RepositoryStrategyFactory.GetLocalLibraryRepository();
            libraries.AddRange(await Context.GetAllAsync());

            return(libraries);
        }
示例#2
0
 public async Task UpdateAsync(Library entity)
 {
     switch (entity.Origin)
     {
     case Origin.Local:
     {
         Context.Strategy = RepositoryStrategyFactory.GetLocalLibraryRepository();
         await Context.UpdateAsync(entity);
     }
     break;
     }
 }
示例#3
0
        public async Task <IEnumerable <Library> > FindAsync(Predicate <Library> predicate)
        {
            var entity = predicate.Target as Library;

            switch (entity.Origin)
            {
            case Origin.Local:
            {
                Context.Strategy = RepositoryStrategyFactory.GetLocalLibraryRepository();
            }
            break;
            }

            return(await Context.FindAsync(predicate));
        }