James G
'Emoji Translator': emoji-api.com doesn't work
Your issue is you're matching the exact
text
to an emoji slug
or unicodeName
, when really the text
is a substring of either. ie pizza
actually has a unicodeName
of E0.6 Pizza
which is your key
in the dictionary _emojis
.
What you need to do is use your wordRegex
against the key
in _emojis
:
7 replies
Cannot return null from an action method with a return type of 'Microsoft.AspNetCore.Mvc.JsonResult'
Generally I'd recommend using the return type
IActionResult
unless you have specific requirements too, ie public async Task<IActionResult> CreateUser
8 replies
Cannot return null from an action method with a return type of 'Microsoft.AspNetCore.Mvc.JsonResult'
For example
Ok
has an underlying type OkObjectResult
which you could use but it's a lot easier to just return Ok(model)
instead of return new OkObjectResult(model)
8 replies
Cannot return null from an action method with a return type of 'Microsoft.AspNetCore.Mvc.JsonResult'
if you return
Ok(model)
it will serialize it to JSON
for you and null values are permitted then. You generally shouldn't need to use the underlying XXXResult
objects8 replies