Example #1
0
        public async Task <Goal> Get(string id)
        {
            var entity = await Goals.LoadWith(o => o.Assignee)
                         .SingleOrDefaultAsync(o => o.Id == id);

            return(entity?.ToDomain());
        }
Example #2
0
        public async Task <Goal[]> GetAll()
        {
            var entities = await Goals.LoadWith(o => o.Assignee)
                           .ToArrayAsync();

            return(entities.Select(o => o.ToDomain()).ToArray());
        }
Example #3
0
        public async Task <Goal[]> Get(params string[] ids)
        {
            var entity = await Goals.LoadWith(o => o.Assignee)
                         .Where(o => o.Id.In(ids))
                         .ToArrayAsync();

            return(entity.Select(o => o.ToDomain()).ToArray());
        }
Example #4
0
        public async Task <Goal[]> GetByUser(string userId)
        {
            var entities = await Goals.LoadWith(o => o.Assignee)
                           .Where(o => o.AssigneeId == userId)
                           .ToArrayAsync();

            return(entities.Select(o => o.ToDomain()).ToArray());
        }