public async Task <ActionResult <List <Customer_CustomerEmailHistoryDTO> > > ListCustomerEmailHistory([FromBody] Customer_CustomerEmailHistoryFilterDTO Customer_CustomerEmailHistoryFilterDTO)
        {
            if (UnAuthorization)
            {
                return(Forbid());
            }
            if (!ModelState.IsValid)
            {
                throw new BindException(ModelState);
            }
            CustomerEmailHistoryFilter CustomerEmailHistoryFilter = new CustomerEmailHistoryFilter();

            CustomerEmailHistoryFilter.Skip          = Customer_CustomerEmailHistoryFilterDTO.Skip;
            CustomerEmailHistoryFilter.Take          = Customer_CustomerEmailHistoryFilterDTO.Take;
            CustomerEmailHistoryFilter.OrderBy       = CustomerEmailHistoryOrder.Id;
            CustomerEmailHistoryFilter.OrderType     = OrderType.ASC;
            CustomerEmailHistoryFilter.Selects       = CustomerEmailHistorySelect.ALL;
            CustomerEmailHistoryFilter.Id            = Customer_CustomerEmailHistoryFilterDTO.Id;
            CustomerEmailHistoryFilter.Title         = Customer_CustomerEmailHistoryFilterDTO.Title;
            CustomerEmailHistoryFilter.Content       = Customer_CustomerEmailHistoryFilterDTO.Content;
            CustomerEmailHistoryFilter.CreatorId     = Customer_CustomerEmailHistoryFilterDTO.CreatorId;
            CustomerEmailHistoryFilter.CreatedAt     = Customer_CustomerEmailHistoryFilterDTO.CreatedAt;
            CustomerEmailHistoryFilter.CustomerId    = Customer_CustomerEmailHistoryFilterDTO.CustomerId;
            CustomerEmailHistoryFilter.EmailStatusId = Customer_CustomerEmailHistoryFilterDTO.EmailStatusId;
            CustomerEmailHistoryFilter.Reciepient    = Customer_CustomerEmailHistoryFilterDTO.Reciepient;

            List <CustomerEmailHistory> CustomerEmailHistorys = await CustomerEmailHistoryService.List(CustomerEmailHistoryFilter);

            List <Customer_CustomerEmailHistoryDTO> Customer_CustomerEmailHistoryDTOs = CustomerEmailHistorys
                                                                                        .Select(x => new Customer_CustomerEmailHistoryDTO(x)).ToList();

            return(Customer_CustomerEmailHistoryDTOs);
        }
        public async Task <ActionResult <Customer_CustomerEmailHistoryDTO> > GetCustomerEmailHistory([FromBody] Customer_CustomerEmailHistoryDTO Customer_CustomerEmailHistoryDTO)
        {
            if (UnAuthorization)
            {
                return(Forbid());
            }
            if (!ModelState.IsValid)
            {
                throw new BindException(ModelState);
            }

            CustomerEmailHistory CustomerEmailHistory = await CustomerEmailHistoryService.Get(Customer_CustomerEmailHistoryDTO.Id);

            return(new Customer_CustomerEmailHistoryDTO(CustomerEmailHistory));
        }
        public async Task <ActionResult <long> > CountCustomerEmailHistory([FromBody] Customer_CustomerEmailHistoryFilterDTO Customer_CustomerEmailHistoryFilterDTO)
        {
            if (UnAuthorization)
            {
                return(Forbid());
            }
            if (!ModelState.IsValid)
            {
                throw new BindException(ModelState);
            }
            CustomerEmailHistoryFilter CustomerEmailHistoryFilter = new CustomerEmailHistoryFilter();

            CustomerEmailHistoryFilter.Id            = Customer_CustomerEmailHistoryFilterDTO.Id;
            CustomerEmailHistoryFilter.Title         = Customer_CustomerEmailHistoryFilterDTO.Title;
            CustomerEmailHistoryFilter.Content       = Customer_CustomerEmailHistoryFilterDTO.Content;
            CustomerEmailHistoryFilter.CreatorId     = Customer_CustomerEmailHistoryFilterDTO.CreatorId;
            CustomerEmailHistoryFilter.CreatedAt     = Customer_CustomerEmailHistoryFilterDTO.CreatedAt;
            CustomerEmailHistoryFilter.CustomerId    = Customer_CustomerEmailHistoryFilterDTO.CustomerId;
            CustomerEmailHistoryFilter.EmailStatusId = Customer_CustomerEmailHistoryFilterDTO.EmailStatusId;
            CustomerEmailHistoryFilter.Reciepient    = Customer_CustomerEmailHistoryFilterDTO.Reciepient;

            return(await CustomerEmailHistoryService.Count(CustomerEmailHistoryFilter));
        }