public static async Task <ObjectId> InsertMember(MembersDB_MemberDTO member)
        {
            await MongoController.MemberCollection.InsertOneAsync(member);

            return(member.Id);
        }
 public static async Task <bool> DeleteFromDB(this MembersDB_MemberDTO member) => await DeleteMember(member.Id);
        public static async Task <bool> ReplaceMember(MembersDB_MemberDTO updatedMember)
        {
            var filter = Builders <MembersDB_MemberDTO> .Filter.Eq("Id", updatedMember.Id);

            return((await MongoController.MemberCollection.ReplaceOneAsync(filter, updatedMember)).MatchedCount == 1);
        }
 public static async Task <ObjectId> Insert(this MembersDB_MemberDTO member) => await InsertMember(member);
示例#5
0
        public async Task ReplaceMember(MembersDB_MemberDTO member)
        {
            await _redisCache.Del($"Member:{member.Id}");

            await Task.Run(() => MemberWorker.ReplaceMember(member));
        }
示例#6
0
 public async Task <ObjectId> InsertMember(MembersDB_MemberDTO newMember) =>
 await Task.Run(() => MemberWorker.InsertMember(newMember));