예제 #1
0
 // 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);
         }
     }
 }
예제 #2
0
        public async ValueTask <bool> AddNewSeparationAsync(Separation separation)
        {
            try
            {
                Separations.Add(new Separation()
                {
                    Address = separation.Address
                });

                await SaveChangesAsync();
            }
            catch
            {
                return(false);
            }

            return(true);
        }
예제 #3
0
        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);
        }
예제 #4
0
 public async Task <List <Separation> > GetSeparationsListAsync() => await Separations.ToListAsync();
예제 #5
0
 public IEnumerable <Separation> GetAllVisitations() => Separations
 .Include(x => x.DoctorList)
 .ThenInclude(x => x.VisitationList)
 .AsEnumerable();