using xCommons.Extensions;
using xContentService.Models.Dtos;
using xContentService.Models.Entities;
namespace xContentService.Extensions
{
///
/// All Service Model's Extensions ...
///
public static class XModelExtensions
{
///
/// Validate a Model ...
///
///
///
public static bool IsValid(this XContent source)
{
//
var result =
!source.IsNullOrDefault() &&
!source.Title.IsNullOrEmpty() &&
!source.OwnerId.IsNullOrEmpty();
//
return result;
}
///
/// Validate a Model ...
///
///
///
public static bool IsValid(this XContentDto source)
{
//
var result =
!source.IsNullOrDefault() &&
!source.Title.IsNullOrEmpty() &&
!source.OwnerId.IsNullOrEmpty();
//
return result;
}
}
}