/// <summary> /// Erzeugt einen Besucher abhängig zu einem Fall /// </summary> /// <param name="visitor">Besucher</param> /// <param name="caseId">Fall Id</param> /// <returns>Async</returns> public async Task CreateDependingVisitorAsync(Visitor visitor, int caseId) { await CreateVisitorAsync(visitor); var dependentSubject = new DependentSubject { CaseId = caseId, VisitorId = visitor.Id }; _db.DependentSubjects.Add(dependentSubject); await _db.SaveChangesAsync(); }
/// <summary> /// Erzeugt eine <see cref="DependentSubjectStateWrapper"/>-Instanz für einen <see cref="DependentSubject"/>. /// </summary> /// <param name="dependentSubject"><see cref="DependentSubject"/>-Instanz, für der Wrapper erzeugt wird.</param> /// <returns>Erzeugter Wrapper.</returns> public async Task <DependentSubjectStateWrapper> CreateStateWrapper(DependentSubject dependentSubject) { var initialState = (await GetDependentSubjectStateAsync(dependentSubject.Id)).CurrentState; return(new DependentSubjectStateWrapper(dependentSubject, initialState, this)); }