Example #1
0
        public async Task <CustomDto> AddCustomGroup(CreateCustomGroupDto createCustomGroupRequest)
        {
            var customGroup = new Domain.CustomEntity.CustomEntityGroup
            {
                Id         = createCustomGroupRequest.Id,
                Name       = createCustomGroupRequest.GroupName,
                AddedDate  = DateTime.UtcNow,
                AddedBy    = 1,
                IsArchived = false,
                IsDeleted  = false
            };
            var response = await _customGroupRepository.AddAsync(customGroup);

            return(response.Id != default(int) ? new CustomDto
            {
                Id = response.Id,
                Caption = response.Name
            } : null);
        }
        public async Task <IActionResult> Post([FromBody] CreateCustomGroupDto createCustomGroupRequest)
        {
            var response = await _customEntityManagementService.AddCustomGroup(createCustomGroupRequest);

            return(Ok(response));
        }