public async Task <BrokerResult> Create(CreateBrokerDto brokerDto) { var IsExist = brokerRepository.IsBrokerExistByName(brokerDto.Name.Trim().ToLower()); if (IsExist) { return(BrokerResult.BrokerIsExist); } var broker = new Broker() { Title = brokerDto.Title.SanitizeText(), Address = brokerDto.Address.SanitizeText(), Description = brokerDto.Description.SanitizeText(), Name = brokerDto.Name.SanitizeText(), Tel = brokerDto.Tel.SanitizeText(), ServiceChargeAccount = brokerDto.ServiceChargeAccount, ServiceChargeCash = brokerDto.ServiceChargeCash, AmountBalanceBroker = 0 }; await brokerRepository.AddEntity(broker); await brokerRepository.SaveChanges(); return(BrokerResult.Success); }