public async Task <Goal> Get(string id) { var entity = await Goals.LoadWith(o => o.Assignee) .SingleOrDefaultAsync(o => o.Id == id); return(entity?.ToDomain()); }
public async Task <Goal[]> GetAll() { var entities = await Goals.LoadWith(o => o.Assignee) .ToArrayAsync(); return(entities.Select(o => o.ToDomain()).ToArray()); }
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()); }
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()); }