add requirements in Content Service ...
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user