示例#1
0
        private UserDataEntity CreateMasterUserId(UserEntity user)
        {
            var dataSource = m_dataSourceUoW.FindDataSourceByDataSource(DataSourceEnum.System).FirstOrDefault();

            return(new UserDataEntity
            {
                Value = Guid.NewGuid().ToString(),
                User = user,
                DataSource = dataSource,
                UserDataType = new UserDataTypeEntity {
                    DataTypeValue = CustomUserDataTypes.MasterUserId
                },
            });
        }
        public DataResult <IList <DataSourceModel> > FindDataSourceByDataSource(DataSourceEnumModel dataSourceEnumModel)
        {
            try
            {
                var dataSourceEnum = m_mapper.Map <DataSourceEnum>(dataSourceEnumModel);

                var dataSource      = m_dataSourceUoW.FindDataSourceByDataSource(dataSourceEnum);
                var dataSourceModel = m_mapper.Map <IList <DataSourceModel> >(dataSource);

                return(Success(dataSourceModel));
            }
            catch (DatabaseException e)
            {
                m_logger.LogWarning(e);
                return(Error <IList <DataSourceModel> >(e.Message));
            }
        }