public async Task <IEnumerable <Library> > GetAllAsync() { var libraries = new List <Library>(); Context.Strategy = RepositoryStrategyFactory.GetLocalLibraryRepository(); libraries.AddRange(await Context.GetAllAsync()); return(libraries); }
public async Task UpdateAsync(Library entity) { switch (entity.Origin) { case Origin.Local: { Context.Strategy = RepositoryStrategyFactory.GetLocalLibraryRepository(); await Context.UpdateAsync(entity); } break; } }
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)); }