Exemple #1
0
        public async Task <GroupModel> JoinUserToGroupById(JoinUserToGroupDataModel model)
        {
            try
            {
                var request = new JoinUserToGroupByIdInputData
                {
                    JoinUserToGroupDataModel = model
                };

                var response = _useCaseFactory
                               .Create <IUseCase <JoinUserToGroupByIdInputData, JoinUserToGroupByIdOutputData> >()
                               .Execute(request);

                logger.Information(
                    $"Type: GroupService; Method: JoinUserToGroupById; Info: Join User To Group By Id: {request.JoinUserToGroupDataModel.GroupId} successfully");


                return(null);
            }
            catch (Exception e)
            {
                logger.Error($"Type: GroupService; Method: JoinUserToGroupById; Error: {e.Message}");
                throw;
            }
        }
Exemple #2
0
        public async Task <object> JoinUserToGroupById(JoinUserToGroupDataModel joinUsers)
        {
            if (Equals(joinUsers, null))
            {
                return(new BadRequestResult());
            }

            GroupModel response;

            try
            {
                response = await groupService.JoinUserToGroupById(joinUsers);

                logger.Information(
                    $"Type: GroupController; Method: JoinUserToGroupById; Info: Join User To Group By Id {joinUsers.GroupId} successfully");
            }
            catch (Exception e)
            {
                logger.Error($"Type: GroupController; Method: JoinUserToGroupById; Error: {e.Message}");
                return(new BadRequestObjectResult(e.Message));
            }

            return(new OkResult());
        }