45 lines
1.2 KiB
C#
45 lines
1.2 KiB
C#
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;
|
|
}
|
|
}
|
|
} |