46 lines
1.2 KiB
C#
46 lines
1.2 KiB
C#
using xCommons.Extensions;
|
|
using xContentService.Models.Dtos;
|
|
using xContentService.Models.Entities;
|
|
|
|
namespace xContentService.Extensions
|
|
{
|
|
/// <summary>
|
|
/// All Service Model's Extensions ...
|
|
/// </summary>
|
|
public static class XModelExtensions
|
|
{
|
|
/// <summary>
|
|
/// Validate a Model ...
|
|
/// </summary>
|
|
/// <param name="source"></param>
|
|
/// <returns></returns>
|
|
public static bool IsValid(this XContent source)
|
|
{
|
|
//
|
|
var result =
|
|
!source.IsNullOrDefault() &&
|
|
!source.Title.IsNullOrEmpty() &&
|
|
!source.OwnerId.IsNullOrEmpty();
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Validate a Model ...
|
|
/// </summary>
|
|
/// <param name="source"></param>
|
|
/// <returns></returns>
|
|
public static bool IsValid(this XContentDto source)
|
|
{
|
|
//
|
|
var result =
|
|
!source.IsNullOrDefault() &&
|
|
!source.Title.IsNullOrEmpty() &&
|
|
!source.OwnerId.IsNullOrEmpty();
|
|
|
|
//
|
|
return result;
|
|
}
|
|
}
|
|
} |