コード例 #1
0
        public async Task <IActionResult> UserCreated([FromBody] PasswordUserModel model)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            var dto = new PasswordUser
            {
                Id       = CreateUserId(model.UserName),
                Email    = model.Email,
                UserName = model.UserName,
                Password = model.Password
            };
            var id = await _store.Create(dto);

            return(Ok(id));
        }
コード例 #2
0
 public async Task Handle(string type, JObject message)
 {
     try
     {
         _logger.LogInformation("Processing message {0}", type);
         if (type == "TopicCheck")
         {
             return;
         }
         message["__messageType"] = type;
         await _store.Create(message);
     }
     catch (Exception ex)
     {
         _logger.LogError(0, ex, "Error processing message");
         throw;
     }
 }