Source

main-vinayFork / Source / WebClient / Web.BizLogic / Extensions / DataDetailExtension.cs

Full commit
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DataUp.Web.DataLayer;

namespace DataUp.Web.BizLogic
{
    /// <summary>
    /// Extension for DataDetail object that represents a uploaded file.
    /// </summary>
    public static class DataDetailExtension
    {
        public static void SetValuesFrom(this DataDetail dataDetail, DocumentStore document)
        {
            if (dataDetail != null && document != null)
            {
                dataDetail.AzureId = Guid.Parse(document.FileId);
                dataDetail.FileName = document.Filename;
                dataDetail.Size = document.Size;
                dataDetail.MimeType = document.MimeType;
            }
        }
    }
}