Exemplo n.º 1
0
        public async Task EditGroup(GroupMemberShipBE group, CancellationToken token)
        {
            var existingGroup = await _flightplanner_entities.GroupMembership.Where(x => x.Id == group.Id).FirstOrDefaultAsync();

            if (existingGroup != null)
            {
                GroupMemberShipMap.Map(group, existingGroup);
                await Save(token);
            }
        }
Exemplo n.º 2
0
 public async Task AddGroup(GroupMemberShipBE group, CancellationToken token)
 {
     _flightplanner_entities.GroupMembership.Add(GroupMemberShipMap.Map(group));
     await Save(token);
 }
Exemplo n.º 3
0
        public async Task <GroupMemberShipBE> GetGroupById(int idGroup)
        {
            var group = await _flightplanner_entities.GroupMembership.Where(x => x.Id == idGroup.ToString()).FirstOrDefaultAsync();

            return(GroupMemberShipMap.Map(group));
        }
Exemplo n.º 4
0
        //public async Task<GroupMemberShipBE> GetGroupInFr(string typeFr)
        //{
        //    var group = await _flightplanner_entities.GroupMembership.Where(x => x.TypeFr == typeFr).FirstOrDefaultAsync();
        //    return GroupMemberShipMap.Map(group);
        //}

        //public async Task<GroupMemberShipBE> GetGroupInEn(string typeEn)
        //{
        //    var group = await _flightplanner_entities.GroupMembership.Where(x => x.TypeEn == typeEn).FirstOrDefaultAsync();
        //    return GroupMemberShipMap.Map(group);
        //}

        public async Task <GroupMemberShipBE> GetRoleByNormalizedRoleName(string normalizedRoleName, CancellationToken token)
        {
            var role = await _flightplanner_entities.GroupMembership.Where(x => x.NormalizedName == normalizedRoleName).FirstOrDefaultAsync(token);

            return(GroupMemberShipMap.Map(role));
        }
Exemplo n.º 5
0
        public async Task <List <GroupMemberShipBE> > GetGroups()
        {
            var groups = await _flightplanner_entities.GroupMembership.ToListAsync();

            return(GroupMemberShipMap.Map(groups));
        }