public async Task <ActionResult <List <Opportunity_OpportunityEmailDTO> > > ListOpportunityEmail([FromBody] Opportunity_OpportunityEmailFilterDTO Opportunity_OpportunityEmailFilterDTO)
        {
            if (UnAuthorization)
            {
                return(Forbid());
            }
            if (!ModelState.IsValid)
            {
                throw new BindException(ModelState);
            }
            OpportunityEmailFilter OpportunityEmailFilter = new OpportunityEmailFilter();

            OpportunityEmailFilter.Skip          = Opportunity_OpportunityEmailFilterDTO.Skip;
            OpportunityEmailFilter.Take          = Opportunity_OpportunityEmailFilterDTO.Take;
            OpportunityEmailFilter.OrderBy       = OpportunityEmailOrder.Id;
            OpportunityEmailFilter.OrderType     = OrderType.ASC;
            OpportunityEmailFilter.Selects       = OpportunityEmailSelect.ALL;
            OpportunityEmailFilter.Id            = Opportunity_OpportunityEmailFilterDTO.Id;
            OpportunityEmailFilter.Title         = Opportunity_OpportunityEmailFilterDTO.Title;
            OpportunityEmailFilter.Content       = Opportunity_OpportunityEmailFilterDTO.Content;
            OpportunityEmailFilter.CreatorId     = Opportunity_OpportunityEmailFilterDTO.CreatorId;
            OpportunityEmailFilter.CreatedAt     = Opportunity_OpportunityEmailFilterDTO.CreatedAt;
            OpportunityEmailFilter.OpportunityId = Opportunity_OpportunityEmailFilterDTO.OpportunityId;
            OpportunityEmailFilter.EmailStatusId = Opportunity_OpportunityEmailFilterDTO.EmailStatusId;
            OpportunityEmailFilter.Reciepient    = Opportunity_OpportunityEmailFilterDTO.Reciepient;

            List <OpportunityEmail> OpportunityEmails = await OpportunityEmailService.List(OpportunityEmailFilter);

            List <Opportunity_OpportunityEmailDTO> Opportunity_OpportunityEmailDTOs = OpportunityEmails
                                                                                      .Select(x => new Opportunity_OpportunityEmailDTO(x)).ToList();

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

            OpportunityEmail OpportunityEmail = await OpportunityEmailService.Get(Opportunity_OpportunityEmailDTO.Id);

            return(new Opportunity_OpportunityEmailDTO(OpportunityEmail));
        }
        public async Task <ActionResult <long> > CountOpportunityEmail([FromBody] Opportunity_OpportunityEmailFilterDTO Opportunity_OpportunityEmailFilterDTO)
        {
            if (UnAuthorization)
            {
                return(Forbid());
            }
            if (!ModelState.IsValid)
            {
                throw new BindException(ModelState);
            }
            OpportunityEmailFilter OpportunityEmailFilter = new OpportunityEmailFilter();

            OpportunityEmailFilter.Id            = Opportunity_OpportunityEmailFilterDTO.Id;
            OpportunityEmailFilter.Title         = Opportunity_OpportunityEmailFilterDTO.Title;
            OpportunityEmailFilter.Content       = Opportunity_OpportunityEmailFilterDTO.Content;
            OpportunityEmailFilter.CreatorId     = Opportunity_OpportunityEmailFilterDTO.CreatorId;
            OpportunityEmailFilter.CreatedAt     = Opportunity_OpportunityEmailFilterDTO.CreatedAt;
            OpportunityEmailFilter.OpportunityId = Opportunity_OpportunityEmailFilterDTO.OpportunityId;
            OpportunityEmailFilter.EmailStatusId = Opportunity_OpportunityEmailFilterDTO.EmailStatusId;
            OpportunityEmailFilter.Reciepient    = Opportunity_OpportunityEmailFilterDTO.Reciepient;

            return(await OpportunityEmailService.Count(OpportunityEmailFilter));
        }