Example #1
0
		private void SetUserByDbResult(UserEntity entity) {
			this._id = entity.Id.ToString();
			this._username = entity.Username;
			this._password = entity.Password;
			this._eMail = entity.eMail;
			this._eMailAliases = entity.eMailAliases;
			this._authorization = entity.Authorization;
			this._status = entity.Status;
		}
Example #2
0
		public bool Add() {
			logger.Info("adding User to Database.");

			MongoDatabase mongoDatabase = this._mongoServer.GetDatabase("email");
			MongoCollection mongoCollection = mongoDatabase.GetCollection<UserEntity>("users");

			UserEntity userEntity = new UserEntity {Username = this.Username, Password = this.Password, eMail = this.eMail, Authorization = this.Authorization, Status = this.Status};
			WriteConcernResult result = mongoCollection.Save(userEntity, WriteConcern.Acknowledged);

			logger.Info("WriteConcernResult: " + result.Ok);

			return result.Ok;
		}