Esempio n. 1
0
        public DataResult <UserBasicInfoModel> GetBasicUserInfoByDataType(string dataType, string dataValue)
        {
            try
            {
                var userEntity = m_userUoW.GetBasicUserInfoByDataType(dataType, dataValue);
                var user       = m_mapper.Map <UserBasicInfoModel>(userEntity);

                return(Success(user));
            }
            catch (NoResultException <UserEntity> e)
            {
                m_logger.LogWarning(e);

                return(Error <UserBasicInfoModel>(m_translator.Translate("invalid-data-type-value"), DataResultErrorCode.UserNotExistUserData));
            }
            catch (DatabaseException e)
            {
                m_logger.LogWarning(e);
                return(Error <UserBasicInfoModel>(e.Message));
            }
        }