| | | 1 | | using LGDXRobotCloud.Data.Models.DTOs.V1.Responses; |
| | | 2 | | |
| | | 3 | | namespace LGDXRobotCloud.Data.Models.Business.Automation; |
| | | 4 | | |
| | | 5 | | public record TriggerListBusinessModel |
| | | 6 | | { |
| | 12 | 7 | | public required int Id { get; set; } |
| | | 8 | | |
| | 10 | 9 | | public required string Name { get; set; } |
| | | 10 | | |
| | 10 | 11 | | public required string Url { get; set; } |
| | | 12 | | |
| | 10 | 13 | | public required int HttpMethodId { get; set; } |
| | | 14 | | } |
| | | 15 | | |
| | | 16 | | public static class TriggerListBusinessModelExtensions |
| | | 17 | | { |
| | | 18 | | public static TriggerListDto ToDto(this TriggerListBusinessModel triggerListBusinessModel) |
| | | 19 | | { |
| | | 20 | | return new TriggerListDto { |
| | | 21 | | Id = triggerListBusinessModel.Id, |
| | | 22 | | Name = triggerListBusinessModel.Name, |
| | | 23 | | Url = triggerListBusinessModel.Url, |
| | | 24 | | HttpMethodId = triggerListBusinessModel.HttpMethodId, |
| | | 25 | | }; |
| | | 26 | | } |
| | | 27 | | |
| | | 28 | | public static IEnumerable<TriggerListDto> ToDto(this IEnumerable<TriggerListBusinessModel> triggerListBusinessModels) |
| | | 29 | | { |
| | | 30 | | return triggerListBusinessModels.Select(p => p.ToDto()); |
| | | 31 | | } |
| | | 32 | | } |