This commit is contained in:
2020-12-28 23:37:16 +00:00
parent 5efee599ec
commit c133553f1a
8 changed files with 57 additions and 47 deletions

View File

@@ -240,7 +240,7 @@ namespace AyaNova.Util
//RATES
await SeedServiceRateAsync(log, 5);
await SeedTravelRateAsync(log, 2);
await SeedTravelRateAsync(log, 3);
//PERF
@@ -309,7 +309,7 @@ namespace AyaNova.Util
//RATES
await SeedServiceRateAsync(log, 10);
await SeedTravelRateAsync(log, 4);
await SeedTravelRateAsync(log, 5);
//PERF
watch.Stop();
@@ -1157,7 +1157,7 @@ namespace AyaNova.Util
//
public async Task SeedServiceRateAsync(ILogger log, int count)
{
for (int x = 0; x < count; x++)
{
ServiceRate o = new ServiceRate();
@@ -1173,7 +1173,7 @@ namespace AyaNova.Util
o.Cost = Fake.Random.Decimal(0.25m, 50);
o.Charge = o.Cost * 1.55m;
o.Unit = "hour";
//This seems wrong to do in a loop but is 4 times faster this way ?!?
@@ -1193,10 +1193,11 @@ namespace AyaNova.Util
}
//////////////////////////////////////////////////////
//SERVICERATE
//TRAVELRATE
//
public async Task SeedTravelRateAsync(ILogger log, int count)
{
var Units = new[] { "km", "miles", "hours" };
for (int x = 0; x < count; x++)
{
@@ -1211,8 +1212,9 @@ namespace AyaNova.Util
o.Notes = Fake.Lorem.Sentence();
o.Tags = RandomTags();
o.Cost = Fake.Random.Decimal(0.25m, 50);
o.Charge = o.Cost * 1.55m;
o.Cost = Fake.Random.Decimal(0.25m, 10);
o.Charge = o.Cost * 2m;
o.Unit = Fake.PickRandom(Units);