초기커밋

This commit is contained in:
2025-05-01 07:20:41 +09:00
commit 98bb2e3c5c
2747 changed files with 646947 additions and 0 deletions

View File

@@ -0,0 +1,39 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Extensions.Options;
using MongoDB.Driver;
using UGQDatabase.Models;
using UGQDataAccess.Settings;
using ServerCommon.UGQ;
namespace UGQDataAccess.Repository
{
public class NpcNameRepository : BaseRepository<NpcNameEntity>
{
private const string CollectionName = "NpcName";
public NpcNameRepository(IMongoClient mongoClient, IOptions<UGQDatabaseSettings> settings) :
base(mongoClient, settings.Value.DatabaseName, CollectionName)
{
}
public async Task upsertNpcName(int npcId, TextEntity npcName)
{
var filter = Builders<NpcNameEntity>.Filter.Eq(x => x.NpcId, npcId);
var update = Builders<NpcNameEntity>.Update
.Set(x => x.NpcName, npcName);
var option = new UpdateOptions
{
IsUpsert = true,
};
await Collection.UpdateOneAsync(filter, update, option);
}
}
}