Implement XFile Provider ...
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
using xCommons.Extensions;
|
||||
using xFileService.Models.Dtos;
|
||||
using xFileService.Models.Entities;
|
||||
|
||||
namespace xFileService.Extensions
|
||||
{
|
||||
public static class xFileServiceExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Map Global Properties From XFile to XFile Dto ...
|
||||
/// </summary>
|
||||
/// <param name="source"></param>
|
||||
/// <returns></returns>
|
||||
public static XFileDto ToXFileDto(this XFile source)
|
||||
{
|
||||
//
|
||||
XFileDto result = null;
|
||||
|
||||
//
|
||||
if (!source.IsNullOrDefault())
|
||||
{
|
||||
//
|
||||
result = new XFileDto();
|
||||
result = result.UpdateData(source);
|
||||
|
||||
//
|
||||
// result = new XFileDto
|
||||
// {
|
||||
// Id = source.Id,
|
||||
// Type = source.Type,
|
||||
// OwnerId = source.OwnerId,
|
||||
// Name = source.Name,
|
||||
// Path = source.Path,
|
||||
// Thumb = source.Thumb,
|
||||
// ThumbPath = source.ThumbPath,
|
||||
// UploadedOn = source.UploadedOn,
|
||||
// FileName = source.FileName
|
||||
// };
|
||||
}
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user