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] }); } } }
// удаление документа 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); }
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); } }
public async Task RemoveJobs(string code) { var filter = new BsonDocument("Code", new BsonDocument("$eq", code)); await Specialities_Proffesions.DeleteManyAsync(filter); }