-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge github.com:ayende/courses-lucerne-oct-2012
Conflicts: .nuget/NuGet.Config .nuget/NuGet.targets
- Loading branch information
Showing
6 changed files
with
92 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
|
||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters