Beispiel #1
0
        //var g = new Guid();
        //    var id = g.ToString();


        //db.GetCollection<MeetingHistory>("MeetingHistories").InsertOne(MeetingHistory);



        //public static void UpdateMeet()
        //{
        //    db.GetCollection<MeetingHistory>("MeetingHistories").UpdateOne(Builders<MeetingHistory>.Filter.Eq("_id", ObjectId.Parse("5b334f67e4df9ee194c8dcbc")),
        //        Builders<MeetingHistory>.Update
        //        .Set("MeetingTitle", "Staj")
        //        .Set("Moderator", "Beyza")
        //);
        //}
        public static async Task <UpdateMeetingHistoryOutput> UpdateMeetingHistory(UpdateMeetingHistoryInput Parameters)
        {
            UpdateMeetingHistoryOutput output = new UpdateMeetingHistoryOutput()
            {
                Type    = 0,
                Message = "Kayıt güncelleme sırasında hata oluştu"
            };

            var filter = Builders <MeetingHistory> .Filter.Eq(Parameters.FilterCol, Parameters.FilterVal);

            var update = Builders <MeetingHistory> .Update
                         .Set(x => x.Title, Parameters.Title)
                         .Set(x => x.FinishDate, Parameters.FinishDate)
                         .Set(x => x.StartDate, Parameters.StartDate)
                         .Set(x => x.Moderator, Parameters.Moderator)
                         .Set(x => x.BranchID, Parameters.BranchID)
                         .Set(x => x.Salloon, Parameters.Salloon)
                         .Set(x => x.ParticipantNumber, Parameters.ParticipantNumber);

            var projection = Builders <MeetingHistory> .Projection;
            var project    = projection.Exclude("_id");

            var result = await db.GetCollection <MeetingHistory>("MeetingHistory").UpdateManyAsync(filter, update);

            if (result.ModifiedCount > 0)
            {
                output.Type    = 1;
                output.Message = result.ModifiedCount + " Kayıt başarıyla güncellendi.";
            }
            return(output);
        }
Beispiel #2
0
 public async Task <UpdateMeetingHistoryOutput> UpdateMeetingHistory(UpdateMeetingHistoryInput Parameters)
 {
     return(await MeetHistoryManager.UpdateMeetingHistory(Parameters));
 }