This repository has been archived by the owner on Oct 5, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
DataManager.cs
73 lines (64 loc) · 1.49 KB
/
DataManager.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace WebApplication13
{
public class DataManager : IDataManager
{
//public string GenerateNumber()
//{
// return “Some data”;
//}
List<int> array = new List<int>();
Random r = new Random();
public DataManager()
{
for (int i = 0; i < 100; i++)
{
array.Add(r.Next());
}
}
public List<int> GenerateNumber()
{
return array;
}
public List<int> GenerateNumber(int start, int end)
{
return array.GetRange(start, end);
}
public int GenerateNumber_Id(int id)
{
return array[id];
}
public bool GenerateNumber_Post(int value)
{
array.Add(value);
return true;
}
public bool GenerateNumber_Put(int id, int value)
{
if (id < array.Count)
{
array[id] = value;
return true;
}
else
{
return false;
}
}
public bool GenerateNumber_Delete(int id)
{
if (id < array.Count)
{
array.RemoveAt(id);
return true;
}
else
{
return false;
}
}
}
}