private static async Task newVersionRepo() { Microsoft.Extensions.Configuration.IConfiguration configuration = new ConfigurationBuilder() .SetBasePath(Directory.GetCurrentDirectory()) .AddJsonFile("appsettings.json").Build(); var cfg = new MapperConfigurationExpression(); cfg.AddProfile <SimsDbMappingProfile>(); var mapperConfig = new MapperConfiguration(cfg); var mapper = new Mapper(mapperConfig); var connection = configuration.GetConnectionString("migrateSims"); var dbContextBuilder = new DbContextOptionsBuilder <SimsDbContext>() .UseSqlServer(connection); using (var ctx = new SimsDbContext(dbContextBuilder.Options)) { var host = SimsDbHost.CreateHost(ctx, mapper, "Paul Lawrence"); var incidentLinks = new IncidentLinkedRecords(ctx, mapper); //var signalLinks = new SignalsLinkedRecords(ctx, mapper); var signalLinks = host.Signals.Links; var Iitems = await incidentLinks.Add(5, new int[] { 8, 10 }, "Money"); var items = await signalLinks.Add(1, new int[] { 2 }, ""); } }
public IncidentNotesRepository(SimsDbContext ctx, IMapper mapper, SimsDbHost simsHost) { this.ctx = ctx; this.mapper = mapper; this.simsHost = simsHost; this.incidentNotes = new NotesRepository<IncidentNoteDb>(ctx, mapper); }
public ProductRepository(SimsDbContext ctx, IMapper mapper) { this.ctx = ctx; this.DbSet = ctx.Set <T>(); this.DbSetDates = ctx.Set <Date>(); this.mapper = mapper; }
public SimsManangement(SimsDbContext ctx, IMapper mapper, ISIMSAttachmentHost attachments, string userId, ILoggerFactory logging) { // unsure about this tbh.... this.SimsDbHost = FSA.SIMSManagerDb.Repositories.SimsDbHost.CreateHost(ctx, mapper, userId); this.attachments = attachments; this.logging = logging; }
private async Task CreateIncidents(ISimsDbHost sims, SimsDbContext ctx, SeedingConfigData seeder) { var iManager = sims.Incidents; List <Task <BaseIncident> > TaskList = new List <Task <BaseIncident> >(); await iManager.Add(seeder.GetNewIncidents()); var coreIncident = seeder.GetNewIncidents().ElementAt(0); var newBatch = new List <BaseIncident>(); for (var x = 0; x < 9000 / 20; ++x) { foreach (var title in this.titleList) { var newIncident = coreIncident.WithTitle($"{title}-{x}") .WithStatus((int)SimsIncidentStatusTypes.Unassigned) .WithLeadOfficer(""); newBatch.Add(newIncident); } } var numbersTest = coreIncident.WithTitle("Number Searching Test Incident 1234 1234.5678 RIM2021.123 RIM2021-123 (1234)") .WithStatus((int)SimsIncidentStatusTypes.Unassigned) .WithLeadOfficer(""); newBatch.Add(numbersTest); await iManager.Add(newBatch); }
public LinkedRecordsRepository(SimsDbContext ctx, IMapper mapper, Func <int, string> publicIdGenerator) { this.ctx = ctx; this.LinkSet = ctx.Set <LinkDb>(); this.NoteSet = ctx.Set <NoteDb>(); this.mapper = mapper; this.publicIdGenerator = publicIdGenerator; }
internal SimsDbHost(SimsDbContext ctx, IMapper mapper) { this.ctx = ctx; this.mapper = mapper; this.Incidents = new IncidentsRepository(ctx, mapper); this.Signals = new SignalsRepository(ctx, mapper); this.Audit = new UserAuditLoggerRepository(ctx); this.Addresses = new AddressRepository(ctx, mapper); this.Lookups = new LookupHost(ctx, mapper); this.OnlineForms = new OnlineFormRepository(ctx, mapper); }
public SignalsRepository(SimsDbContext ctx, IMapper mapper) { this.ctx = ctx; this.mapper = mapper; }
public AttachmentsRepository(SimsDbContext ctx, IMapper mapper) { this.DbSet = ctx.Set <AttachmentDb>(); this.ctx = ctx; this.mapper = mapper; }
public OnlineFormRepository(SimsDbContext ctx, IMapper mapper) { this.ctx = ctx; this.mapper = mapper; }
public SignalNotesRepository(SimsDbContext ctx, IMapper mapper) { this.ctx = ctx; this.SignalNotes = new NotesRepository <SignalNoteDb>(ctx, mapper); }
internal ReferenceDataRepo(SimsDbContext ctx, Func <SimsDbContext, List <Db> > customFetch, Func <Db, T> toClient) : this(ctx, toClient) { this._customFetch = customFetch; }
internal ReferenceDataRepo(SimsDbContext ctx, Func <Db, T> toClient) { this.ctx = ctx; this.toClient = toClient; }
internal ReferenceDataRepo(SimsDbContext ctx, Func <SimsDbContext, Task <List <Db> > > customAsyncFetch, Mapper mapper) : this(ctx, mapper) { this._customAsyncFetch = customAsyncFetch; }
internal ReferenceDataRepo(SimsDbContext ctx, IMapper mapper) { this.ctx = ctx; this.toClient = (itm) => mapper.Map <Db, T>(itm); }
public StakeholdersRepository(SimsDbContext ctx, IMapper mapper) { this.ctx = ctx; this.DbSet = ctx.Set <T>(); this.mapper = mapper; }
public static ISimsDbHost CreateHost(SimsDbContext ctx, IMapper mapper, string userId) { ctx.SetEditor(userId); return(new SimsDbHost(ctx, mapper)); }
public NotesRepository(SimsDbContext ctx, IMapper mapper) { this.ctx = ctx; this.NoteSet = ctx.Set <NoteDb>(); this.mapper = mapper; }
public AddressRepository(SimsDbContext ctx, IMapper mapper) { this.ctx = ctx; this.mapper = mapper; }
public ProductFboRepository(SimsDbContext ctx, IMapper mapper) { this.ctx = ctx; this.DbSet = ctx.Set <ProductFBO>(); this.mapper = mapper; }
public IncidentsRepository(SimsDbContext ctx, IMapper mapper) { this.ctx = ctx; this.mapper = mapper; }
public UserAuditLoggerRepository(SimsDbContext ctx) { this.ctx = ctx; }
public LookupHost(SimsDbContext ctx, IMapper mapper) { this.ctx = ctx; this.mapper = mapper; }