This commit is contained in:
2020-12-14 18:49:13 +00:00
parent 6b8c20d0e7
commit de0d5d35d0

View File

@@ -705,6 +705,35 @@ namespace AyaNova.Util
await SeedUserAsync(log, 1, AuthorizationRoles.SubContractorLimited, UserType.ServiceContractor, true, "SubContractorLimited", "SubContractorLimited", 0, KnownUserTags, VendorIdForSubContractorUser, null, null);
await SeedUserAsync(log, 1, AuthorizationRoles.SubContractorFull, UserType.ServiceContractor, true, "SubContractorFull", "SubContractorFull", 0, KnownUserTags, VendorIdForSubContractorUser, null, null);
}
/////////////////////////////////////////////////////
//Seed some test memos
{
for (int x = 0; x < 10; x++)
{
Memo memo = new Memo();
memo.Name = Fake.Lorem.Sentence();
memo.Notes = Fake.Rant.Review();
memo.ToId = 1;
memo.FromId = Fake.Random.Long(2, 15);
memo.Tags = RandomTags();
using (AyContext ct = ServiceProviderProvider.DBContext)
{
MemoBiz biz = MemoBiz.GetBiz(ct);
var NewObject = await biz.CreateAsync(memo);
if (NewObject == null)
{
var err = $"Seeder::SeedKnownObjects error creating memo\r\n{biz.GetErrorsAsString()}";
log.LogError(err);
throw new System.Exception(err);
}
}
}
}
///////////////////////////////////////////////
}
catch
{