コード例 #1
0
        protected override async Task <JsonResult> EntityNameQuery(NetworkEntityGuid entityGuid)
        {
            if (entityGuid.EntryId <= 0)
            {
                return(BuildFailedResponseModel(NameQueryResponseCode.UnknownIdError));
            }

            bool knownId = await CreatureEntryRepository.ContainsAsync(entityGuid.EntryId);

            //TODO: JSON Response
            if (!knownId)
            {
                return(BuildFailedResponseModel(NameQueryResponseCode.UnknownIdError));
            }

            //TODO: Make accessing template more efficient than loading ALL navaigation properties.
            //Else if it is a known id we should grab the name of the character
            CreatureEntryModel entryModel = await CreatureEntryRepository.RetrieveAsync(entityGuid.EntryId, true);

            return(BuildSuccessfulResponseModel(new NameQueryResponse(entryModel.CreatureTemplate.CreatureName)));
        }
コード例 #2
0
 public Task UpdateAsync(int key, CreatureEntryModel model)
 {
     return(GenericRepository.UpdateAsync(key, model));
 }
コード例 #3
0
 public Task <bool> TryCreateAsync(CreatureEntryModel model)
 {
     return(GenericRepository.TryCreateAsync(model));
 }