コード例 #1
0
 public async Task CreateProff(string code, string[] proff)
 {
     for (int i = 0; i < proff.Length; i++)
     {
         if (proff[i] != null && proff[i] != "")
         {
             await Specialities_Proffesions.InsertOneAsync(new Speciality_Proffesion { Code = code, Proffesion = proff[i] });
         }
     }
 }
コード例 #2
0
        // удаление документа
        public async Task Remove(string code)
        {
            var filter = new BsonDocument("Code", new BsonDocument("$eq", code));
            await Specialities.DeleteOneAsync(filter);

            await Specialities_Proffesions.DeleteManyAsync(filter);

            await Specialities_Subjects.DeleteManyAsync(filter);

            await Comment_Specialities.DeleteManyAsync(filter);
        }
コード例 #3
0
        public async Task <List <Speciality_Proffesion> > GetSpecialityProffs(string code)
        {
            List <Speciality_Proffesion> results = null;
            var filter = new BsonDocument("Code", new BsonDocument("$eq", code));

            results = await Specialities_Proffesions.Find <Speciality_Proffesion>(filter).ToListAsync();

            if (results != null)
            {
                return(results);
            }
            else
            {
                return(null);
            }
        }
コード例 #4
0
 public async Task RemoveJobs(string code)
 {
     var filter = new BsonDocument("Code", new BsonDocument("$eq", code));
     await Specialities_Proffesions.DeleteManyAsync(filter);
 }