Skip to content

Commit 5013e93

Browse files
committed
Add one more code and cleanup code
1 parent 21cdf64 commit 5013e93

File tree

6 files changed

+13
-26
lines changed

6 files changed

+13
-26
lines changed

samples/docker-compose/dotnet/Controllers/HomeController.cs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
using System.Collections.Generic;
21
using System.Linq;
32
using System.Threading.Tasks;
43
using dotnet.Models;
@@ -39,13 +38,15 @@ public HomeController(Box box)
3938

4039
public async Task<ViewResult> Index()
4140
{
42-
var primaryData = await this._primaryIndex.Select<Tuple<long>, Tuple<long, string, long>>(Tuple.Create(-1L), new SelectOptions { Iterator = Iterator.All });
43-
var secondaryData = await this._secondaryIndex.Select<Tuple<long>, Tuple<long, string, long>>(Tuple.Create(5L), new SelectOptions { Iterator = Iterator.Ge });
41+
var allDogs = await this._primaryIndex.Select<Tuple<long>, Tuple<long, string, long>>(Tuple.Create(-1L), new SelectOptions { Iterator = Iterator.All });
42+
var seniorDogs = await this._secondaryIndex.Select<Tuple<long>, Tuple<long, string, long>>(Tuple.Create(5L), new SelectOptions { Iterator = Iterator.Ge });
43+
var juniorDogs = await this._secondaryIndex.Select<Tuple<long>, Tuple<long, string, long>>(Tuple.Create(5L), new SelectOptions { Iterator = Iterator.Le });
4444

45-
return View(new TestData
45+
return View(new []
4646
{
47-
AllDogs = primaryData.Data.Select(x => new Dog(x)).ToArray(),
48-
DogsOlder5Years = secondaryData.Data.Select(x => new Dog(x)).ToArray()
47+
allDogs.Data.Select(x => new Dog(x)).ToArray(),
48+
seniorDogs.Data.Select(x => new Dog(x)).ToArray(),
49+
juniorDogs.Data.Select(x => new Dog(x)).ToArray()
4950
});
5051
}
5152
}

samples/docker-compose/dotnet/Models/TestData.cs

Lines changed: 0 additions & 11 deletions
This file was deleted.

samples/docker-compose/dotnet/Program.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
using System;
2-
using System.Collections.Generic;
31
using System.IO;
4-
using System.Linq;
5-
using System.Threading.Tasks;
62
using Microsoft.AspNetCore.Hosting;
73
using Microsoft.Extensions.Configuration;
84

samples/docker-compose/dotnet/Startup.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
using System;
2-
using System.Collections.Generic;
31
using System.Linq;
42
using System.Net;
53
using System.Net.Sockets;
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
@using dotnet.Models
2-
@model TestData
2+
@model Dog[][]
33
@{
44
ViewData["Title"] = "Tarantool demo page";
55
}
66

7-
@Html.Partial("DogTablePartial", new DogTable(Model.AllDogs, "All dogs in Tarantool"))
7+
@Html.Partial("DogTablePartial", new DogTable(Model[0], "All dogs in Tarantool"))
88

9-
@Html.Partial("DogTablePartial", new DogTable(Model.DogsOlder5Years, "Senior dogs in Tarantool"))
9+
@Html.Partial("DogTablePartial", new DogTable(Model[1], "Senior dogs in Tarantool"))
10+
11+
@Html.Partial("DogTablePartial", new DogTable(Model[2], "Junior dogs in Tarantool"))

samples/docker-compose/tarantool/sample.init.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ end
5050
local function data()
5151
box.space.some_space:auto_increment{'Masya', 10}
5252
box.space.some_space:auto_increment{'Armata', 0}
53+
box.space.some_space:auto_increment{'Bonya', 5}
5354
end
5455

5556
box.once('init', init)

0 commit comments

Comments
 (0)