Exemple #1
0
        public async Task <GroupResponseModel> CreateNewGroupAsync(NewGroupRequestModel newGroup)
        {
            var newGroupEntity = _mapper.Map <NewGroupRequestModel, GroupEntity>(newGroup);

            newGroupEntity.Members = new List <int>
            {
                newGroup.CreatedUserId
            };
            return(_mapper.Map <GroupEntity, GroupResponseModel>(await _groupRepository.CreateAsync(newGroupEntity)));
        }
Exemple #2
0
 public async Task <ActionResult <GroupResponseModel> > CreateGroupAsync([FromBody] NewGroupRequestModel newGroup)
 {
     return(Ok(await _groupManager.CreateNewGroupAsync(newGroup)));
 }