public async Task <ActionResult> AddPaymentKind([FromBody] PaymentKindDto paymentTerm)
        {
            int id          = int.Parse(User.FindFirst(ClaimTypes.NameIdentifier).Value);
            var logineduser = await _auth.VerifyUser(id);

            PaymentKind _newTerm = new PaymentKind()
            {
                Status  = true,
                Company = logineduser.Company
            };

            _context.PaymentKinds.Add(_newTerm);
            await _context.SaveChangesAsync();

            foreach (var item in paymentTerm.ContentForLang)
            {
                PaymentKindLanguage termLang = new PaymentKindLanguage()
                {
                    PaymentKind = _newTerm,
                    Language    = await _context.Languages.FirstOrDefaultAsync(s => s.code == item.Languagename),
                    Name        = item.Content
                };
                _context.PaymentKindLanguages.Add(termLang);
                await _context.SaveChangesAsync();
            }
            return(Ok());
        }
        public async Task <ActionResult> GetPaymentKindForId(int id)
        {
            PaymentKindDto data = await _context.PaymentKinds.Where(s => s.Id == id).Select(s => new PaymentKindDto()
            {
                Id             = s.Id,
                ContentForLang = s.PaymentKindLanguages.Select(l => new SimpleforDtos.LangcontentDto()
                {
                    Content      = l.Name,
                    Languagename = l.Language.code
                }).ToList()
            }).FirstOrDefaultAsync();

            return(Ok(data));
        }
        public async Task <ActionResult> EditTask(int id, [FromBody] PaymentKindDto termDto)
        {
            if (id != termDto.Id)
            {
                return(BadRequest("Idler duzgun deyil"));
            }
            foreach (var item in termDto.ContentForLang)
            {
                var termlang = await _context.PaymentKindLanguages.Include(s => s.PaymentKind).FirstOrDefaultAsync(s => s.PaymentKind.Id == termDto.Id && s.Language.code == item.Languagename);

                termlang.Name = item.Content;
                _context.Entry(termlang).State = EntityState.Modified;
                await _context.SaveChangesAsync();
            }
            return(Ok());
        }