public async Task <IActionResult> GetCommandDescriptor([FromServices] IFaultTolerantProvider faultTolerantProvider, string serviceId, string address) { IEnumerable <ServiceCommandDescriptor> list = null; if (!string.IsNullOrEmpty(serviceId)) { list = await faultTolerantProvider.GetCommandDescriptor(serviceId); } else if (!string.IsNullOrEmpty(address)) { list = await faultTolerantProvider.GetCommandDescriptorByAddress(address); } var result = ServiceResult <IEnumerable <ServiceCommandDescriptor> > .Create(true, list); return(Json(result)); }
public async Task <IActionResult> EditFaultTolerant([FromServices] IFaultTolerantProvider faultTolerantProvider, ServiceCommandDescriptor model) { await faultTolerantProvider.SetCommandDescriptorByAddress(model); return(Json(ServiceResult.Create(true))); }
public async Task <IActionResult> EditFaultTolerant([FromServices] IFaultTolerantProvider faultTolerantProvider, string serviceId) { var list = await faultTolerantProvider.GetCommandDescriptor(serviceId); return(View(list.FirstOrDefault())); }