Aura.Msgr.Database.MsgrDb.GetNote C# (CSharp) Method

GetNote() public method

Returns note with given id, or null on error.
public GetNote ( long noteId ) : Note
noteId long
return Note
		public Note GetNote(long noteId)
		{
			Note note = null;

			using (var conn = this.Connection)
			using (var mc = new MySqlCommand("SELECT * FROM `notes` WHERE `noteId` = @noteId", conn))
			{
				mc.Parameters.AddWithValue("@noteId", noteId);

				using (var reader = mc.ExecuteReader())
				{
					if (reader.Read())
						note = this.ReadNote(reader);
				}
			}

			return note;
		}