// TODO private void AddOrSkipExistensSeparationsRange(ICollection <Separation> separations, ICollection <Separation> contextSeparations) { foreach (var separation in separations) { if (!contextSeparations.Contains(separation)) { separation.SeparationId = 0; Separations.Add(separation); } } }
public async ValueTask <bool> AddNewSeparationAsync(Separation separation) { try { Separations.Add(new Separation() { Address = separation.Address }); await SaveChangesAsync(); } catch { return(false); } return(true); }
public async ValueTask <bool> AddNewDoctorAsync(int separationId, Doctor doctor) { try { var sep = await Separations .Where(s => s.SeparationId == separationId) .FirstOrDefaultAsync(); if (sep == null) { return(false); } sep.DoctorList.Add(doctor); await SaveChangesAsync(); } catch { return(false); } return(true); }
public async Task <List <Separation> > GetSeparationsListAsync() => await Separations.ToListAsync();
public IEnumerable <Separation> GetAllVisitations() => Separations .Include(x => x.DoctorList) .ThenInclude(x => x.VisitationList) .AsEnumerable();