我使用 .net 核心应用程序创建了 API,该应用程序用于将一组属性发送到 SQL DB,并且还应将消息的一个副本发送到 azure 服务总线主题。截至目前 .net 核心不支持服务总线。请分享您的想法。如何使用 .net 核心应用程序将消息发送到服务总线主题?
public class CenterConfigurationsDetails
{
public Guid Id { get; set; } = Guid.NewGuid();
public Guid? CenterReferenceId { get; set; } = Guid.NewGuid();
public int? NoOfClassRooms { get; set; }
public int? OtherSpaces { get; set; }
public int? NoOfStudentsPerEncounter { get; set; }
public int? NoOfStudentsPerComplimentaryClass { get; set; }
}
// POST api/centers/configurations
[HttpPost]
public IActionResult Post([FromBody]CenterConfigurationsDetails centerConfigurationsDetails)
{
if (centerConfigurationsDetails == null)
{
return BadRequest();
}
if (_centerConfigurationModelCustomValidator.IsValid(centerConfigurationsDetails, ModelState))
{
var result = _centerConfigurationService.CreateCenterConfiguration(centerConfigurationsDetails);
return Created($"{Request.Scheme}://{Request.Host}{Request.Path}", result);
}
var messages = ModelState.Values.SelectMany(v => v.Errors).Select(e => e.ErrorMessage).ToList();
return BadRequest(messages);
}