public IEnumerable<World> GetWorlds() { using (var context = new ObjectPathContext()) { return context.Worlds.ToList(); } }
public async Task<Animation> GetAnimationAsync(int worldId, string animationName) { using (var context = new ObjectPathContext()) { return await _animationLocator.GetResourceAsync(await context.Animations.SingleOrDefaultAsync(entity => entity.WorldId == worldId && entity.Name == animationName)); } }
public async Task<byte[]> GetTextureAsync(int worldId, string textureName) { using (var context = new ObjectPathContext()) { return await _textureLocator.GetResourceAsync(await context.Textures.SingleOrDefaultAsync(entity => entity.WorldId == worldId && entity.Name == textureName)); } }
public async Task<Model> GetModelAsync(int worldId, string modelName) { using (var context = new ObjectPathContext()) { return await _modelLocator.GetResourceAsync(await context.Models.SingleOrDefaultAsync(entity => entity.WorldId == worldId && entity.Name == modelName)); } }
public async Task<IEnumerable<Model>> GetWorldModels(int id) { using (var context = new ObjectPathContext()) { var world = await context.Worlds.FindAsync(id); return world == null ? Enumerable.Empty<Model>() : world.Models; } }
public async Task<IEnumerable<Animation>> GetWorldAnimations(int id) { using (var context = new ObjectPathContext()) { var world = await context.Worlds.FindAsync(id); return world == null ? Enumerable.Empty<Animation>() : world.Animations; } }