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);
public async Task ReplaceMember(MembersDB_MemberDTO member) { await _redisCache.Del($"Member:{member.Id}"); await Task.Run(() => MemberWorker.ReplaceMember(member)); }
public async Task <ObjectId> InsertMember(MembersDB_MemberDTO newMember) => await Task.Run(() => MemberWorker.InsertMember(newMember));