Beispiel #1
0
        public async Task <InteractionResponseModel> CreateInteraction(InteractionRequestModel interactionRequestModel)
        {
            var interaction = new Interactions
            {
                ClientId = interactionRequestModel.ClientId,
                EmpId    = interactionRequestModel.EmpId,
                IntType  = interactionRequestModel.type,
                IntDate  = interactionRequestModel.Date,
                Remarks  = interactionRequestModel.Remarks,
            };
            var createdInteraction = await _interactionsRepository.AddAsync(interaction);

            var response = new InteractionResponseModel
            {
                Id       = createdInteraction.Id,
                ClientId = createdInteraction.ClientId,
                EmpId    = createdInteraction.EmpId,
                type     = createdInteraction.IntType,
                Date     = createdInteraction.IntDate,
                Remarks  = createdInteraction.Remarks,
            };

            return(response);
        }
        public async Task <IActionResult> CreateInteraction(InteractionRequestModel interactionRequestModel)
        {
            var createdInteraction = await _interactionsService.CreateInteraction(interactionRequestModel);

            return(CreatedAtRoute("GetInteraction", new { id = createdInteraction.Id }, createdInteraction));
        }