| 123456789101112131415161718192021 |
- using System;
- using System.Collections.Generic;
- namespace Quadarax.Foundation.Core.Data.Interface.Entity.Dto.Extensions
- {
- public static class DtoExt
- {
- public static ResultValueDto<TDto> AsResult<TDto>(this TDto value) where TDto : IDto, new()
- {
- if (value == null)
- throw new ArgumentNullException(nameof(value));
- return new ResultValueDto<TDto>(value);
- }
- public static ResultsValueDto<TDto> AsResult<TDto>(this IEnumerable<TDto> values) where TDto : IDto
- {
- if (values == null)
- throw new ArgumentNullException(nameof(values));
- return new ResultsValueDto<TDto>(values);
- }
- }
- }
|