Exemplo n.º 1
0
        public override async Task AddAsync(Kullanici entity, UserHelper userHelper)
        {
            await Kontrol(entity);

            Random rnd = new Random();

            entity.Token = rnd.Next(1200, 9980).ToString();
            entity.Sifre = entity.Token;
            try
            {
                await _kisiServis.AddAsync(entity.Kisi, userHelper);

                await base.AddAsync(entity, userHelper);
            }
            catch (Exception ex)
            {
                if (entity.Kisi.Id > 0)
                {
                    await _kisiServis.DeleteAsync(entity.Kisi.Id, userHelper);
                }
                throw ex;
            }
            //ResetlemeMailiGonder(entity.Id, entity.Token, entity.Kisi.EPosta);
        }
Exemplo n.º 2
0
        public override async Task DeleteAsync(int id, UserHelper userHelper)
        {
            await _kisiServis.DeleteAsync(id, userHelper);

            await base.DeleteAsync(id, userHelper);
        }