Skip to content

Commit

Permalink
Merge github.com:ayende/courses-lucerne-oct-2012
Browse files Browse the repository at this point in the history
Conflicts:
	.nuget/NuGet.Config
	.nuget/NuGet.targets
  • Loading branch information
ayende committed Oct 1, 2012
2 parents 854c3d8 + b8b1b67 commit 5f4b9a4
Show file tree
Hide file tree
Showing 6 changed files with 92 additions and 0 deletions.
7 changes: 7 additions & 0 deletions bbv.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "bbv", "bbv\bbv.csproj", "{AA77CFA2-F440-4DF4-879F-CC86E9D604BC}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{91ADF548-6EE3-485E-B111-ABE511E4B1EE}"
ProjectSection(SolutionItems) = preProject
.nuget\NuGet.Config = .nuget\NuGet.Config
.nuget\NuGet.exe = .nuget\NuGet.exe
.nuget\NuGet.targets = .nuget\NuGet.targets
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down
22 changes: 22 additions & 0 deletions bbv/Controllers/StudentController.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using bbv.Models;

namespace bbv.Controllers
{
public class StudentController : RavenController
{
public object New(string firstName, string lastName, string email)
{
var student = new Student
{
FirstName = firstName,
LastName = lastName,
Email = email
};

Session.Store(student);

return Json(student.Id);

}
}
}
23 changes: 23 additions & 0 deletions bbv/Controllers/UserController.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using System;
using bbv.Models;

namespace bbv.Controllers
{
public class UserController : RavenController
{
public object New(string name, string email, string nicks, string hobbies)
{
var user = new User
{
Name = name,
Email = email,
};
user.Nicks.AddRange(nicks.Split(new []{","}, StringSplitOptions.RemoveEmptyEntries));
user.Hobbies.AddRange(hobbies.Split(new []{","}, StringSplitOptions.RemoveEmptyEntries));

Session.Store(user);

return Json(user.Id);
}
}
}
13 changes: 13 additions & 0 deletions bbv/Models/Student.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
namespace bbv.Models
{
public class Student
{
public string FirstName { get; set; }

public string LastName { get; set; }

public string Email { get; set; }

public string Id { get; set; }
}
}
23 changes: 23 additions & 0 deletions bbv/Models/User.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using System.Collections.Generic;

namespace bbv.Models
{
public class User
{
public User()
{
this.Nicks = new List<string>();
this.Hobbies = new List<string>();
}

public string Name { get; set; }

public string Email { get; set; }

public string Id { get; set; }

public List<string> Nicks { get; private set; }

public List<string> Hobbies { get; private set; }
}
}
4 changes: 4 additions & 0 deletions bbv/bbv.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,14 @@
<ItemGroup>
<Compile Include="Controllers\CourseController.cs" />
<Compile Include="Controllers\RavenController.cs" />
<Compile Include="Controllers\StudentController.cs" />
<Compile Include="Controllers\UserController.cs" />
<Compile Include="Global.asax.cs">
<DependentUpon>Global.asax</DependentUpon>
</Compile>
<Compile Include="Models\Course.cs" />
<Compile Include="Models\Student.cs" />
<Compile Include="Models\User.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
Expand Down

0 comments on commit 5f4b9a4

Please sign in to comment.