Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c58470e
commit 1387cdf
Showing
5 changed files
with
894 additions
and
21 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 |
---|---|---|
@@ -1,22 +1,36 @@ | ||
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); | ||
|
||
} | ||
} | ||
using bbv.Models; | ||
|
||
namespace bbv.Controllers | ||
{ | ||
using Raven.Client; | ||
|
||
public class StudentController : RavenController | ||
{ | ||
public object AddSome() | ||
{ | ||
for (int i = 0; i < 100; i++) | ||
{ | ||
this.New( | ||
"First " + i, | ||
"Last " + i, | ||
"foo@bar.com"); | ||
} | ||
return Json("Done"); | ||
} | ||
|
||
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,24 @@ | ||
namespace bbv.Infrastructure.Indexes | ||
{ | ||
using System.Linq; | ||
|
||
using Raven.Client.Indexes; | ||
|
||
using bbv.Models; | ||
|
||
public class Orders_Search : AbstractIndexCreationTask<Order, Orders_Search.RevenueResult> | ||
{ | ||
public class RevenueResult | ||
{ | ||
public decimal Revenue { get; set; } | ||
} | ||
|
||
public Orders_Search() | ||
{ | ||
this.Map = orders => from o in orders | ||
select new { | ||
Revenue = (o.Cost * o.Participants) | ||
}; | ||
} | ||
} | ||
} |
Oops, something went wrong.