Subversion Repositories blog-sources

Compare Revisions

Ignore whitespace Rev 7 → Rev 8

/mono-mongodb/Race/Race.sln
0,0 → 1,20

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Race", "Race\Race.csproj", "{7954368F-3754-423C-B1D4-3F97C4EB6BD0}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x86 = Debug|x86
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{7954368F-3754-423C-B1D4-3F97C4EB6BD0}.Debug|x86.ActiveCfg = Debug|x86
{7954368F-3754-423C-B1D4-3F97C4EB6BD0}.Debug|x86.Build.0 = Debug|x86
{7954368F-3754-423C-B1D4-3F97C4EB6BD0}.Release|x86.ActiveCfg = Release|x86
{7954368F-3754-423C-B1D4-3F97C4EB6BD0}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(MonoDevelopProperties) = preSolution
StartupItem = Race\Race.csproj
EndGlobalSection
EndGlobal
/mono-mongodb/Race/Race/AssemblyInfo.cs
0,0 → 1,27
using System.Reflection;
using System.Runtime.CompilerServices;
 
// Information about this assembly is defined by the following attributes.
// Change them to the values specific to your project.
 
[assembly: AssemblyTitle("Race")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("jlesech")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
 
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
 
[assembly: AssemblyVersion("1.0.*")]
 
// The following attributes are used to specify the signing key for the assembly,
// if desired. See the Mono documentation for more information about signing.
 
//[assembly: AssemblyDelaySign(false)]
//[assembly: AssemblyKeyFile("")]
 
/mono-mongodb/Race/Race/Participant.cs
0,0 → 1,115
using System;
 
namespace Race
{
public class Participant
{
#region Fields
 
private string firstName = string.Empty;
private string lastName = string.Empty;
private UInt16 yearOfBirth = 0;
private string email = null;
 
#endregion
 
#region Constructors
 
/// <summary>
/// Initializes a new instance of the <see cref="Race.Participant"/> class.
/// </summary>
/// <param name='firstName'>
/// First name.
/// </param>
/// <param name='lastName'>
/// Last name.
/// </param>
/// <param name='yearOfBirth'>
/// Year of birth.
/// </param>
public Participant (string firstName, string lastName, UInt16 yearOfBirth)
{
this.firstName = firstName;
this.lastName = lastName;
this.yearOfBirth = yearOfBirth;
}
 
/// <summary>
/// Initializes a new instance of the <see cref="Race.Participant"/> class.
/// </summary>
/// <param name='firstName'>
/// First name.
/// </param>
/// <param name='lastName'>
/// Last name.
/// </param>
/// <param name='yearOfBirth'>
/// Year of birth.
/// </param>
/// <param name='email'>
/// Email.
/// </param>
public Participant(string firstName, string lastName, UInt16 yearOfBirth, string email)
{
this.firstName = firstName;
this.lastName = lastName;
this.yearOfBirth = yearOfBirth;
this.email = email;
}
 
#endregion
 
#region Properties
 
/// <summary>
/// Gets or sets the first name.
/// </summary>
/// <value>
/// The first name.
/// </value>
public string FirstName
{
get { return this.firstName; }
set { this.firstName = value; }
}
 
/// <summary>
/// Gets or sets the last name.
/// </summary>
/// <value>
/// The last name.
/// </value>
public string LastName
{
get { return this.lastName; }
set { this.lastName = value; }
}
 
/// <summary>
/// Gets or sets the year of birth.
/// </summary>
/// <value>
/// The year of birth.
/// </value>
public UInt16 YearOfBirth
{
get { return this.yearOfBirth; }
set { this.yearOfBirth = value; }
}
 
/// <summary>
/// Gets or sets the email.
/// </summary>
/// <value>
/// The email.
/// </value>
public string Email
{
get { return this.email; }
set { this.email = value; }
}
 
#endregion
}
}
 
/mono-mongodb/Race/Race/Main.cs
0,0 → 1,29
using System;
 
using MongoDB.Driver;
 
namespace Race
{
class MainClass
{
public static void Main (string[] args)
{
// Get a Reference to the Client Object.
string connectionString = "mongodb://localhost";
MongoClient client = new MongoClient(connectionString);
 
// Get a Reference to a Server Object.
MongoServer server = client.GetServer();
 
// Get a Reference to a Database Object.
MongoDatabase database = server.GetDatabase("Race");
 
// Get a Reference to a Collection Object.
MongoCollection collection = database.GetCollection<Participant>("Participants");
 
// Insert a Document.
Participant participant = new Participant("Jean-Claude", "Duss", 1952);
collection.Insert(participant);
}
}
}
/mono-mongodb/Race/Race/Race.csproj
0,0 → 1,45
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>10.0.0</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{7954368F-3754-423C-B1D4-3F97C4EB6BD0}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>Race</RootNamespace>
<AssemblyName>Race</AssemblyName>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug</OutputPath>
<DefineConstants>DEBUG;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x86</PlatformTarget>
<Externalconsole>true</Externalconsole>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<DebugType>none</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x86</PlatformTarget>
<Externalconsole>true</Externalconsole>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="MongoDB.Driver">
<HintPath>..\..\..\Downloads\CSharpDriver-1.9-rc0\MongoDB.Driver.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Main.cs" />
<Compile Include="AssemblyInfo.cs" />
<Compile Include="Participant.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
</Project>