Exemplo n.º 1
0
        /// <summary>
        /// Yeni kayit icin girilmek istenilen E-Mail degerinin daha onceden kullanilip kullanilmadigini kontrol etmeye yarayan fonksiyon
        /// </summary>
        /// <param name="mailToCheck">Kontrol edilmek istenilen E-Mail degeri</param>
        /// <returns>Eger E-Mail degeri kullanilmamis ise false, kullanilmis ise true olarak deger dondurur</returns>
        bool CheckIfExistsEmail(String mailToCheck)
        {
            bool resultToReturn = default(bool);

            mailToCheck = mailToCheck.ConvertTurkishCharactersToEnglishCharacters();

            ExtensionsOfAction.TryCatch(
                action: () =>
            {
                DTOOfUser getUserByEmail = this.FetchAnyUserByWhereConditions(whereConditions: x => x.Email == mailToCheck);
                resultToReturn           = getUserByEmail == null ? false : true;
            }
                );
            return(resultToReturn);
        }
Exemplo n.º 2
0
 void IUnitOfWork.CommitTransaction()
 {
     if (this.DbContextTransaction != null)
     {
         ExtensionsOfAction.TryCatch(
             action: () => this.DbContextTransaction.Commit(),
             catchAndDo: (Exception exception) =>
         {
             this.DbContextTransaction.Rollback();
             throw exception;
         },
             finallyDo: () => { this.DbContextTransaction.Dispose(); this.DbContext.Dispose(); }
             );
     }
     else
     {
         throw new ArgumentNullException(message: ConstantsOfErrors.ArgumentNullExceptionMessageForDbContextTransaction,
                                         innerException: null);
     }
 }