using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Web; using EnVisage.Code; namespace EnVisage.Models { class MongoDBBackupModel : IBaseModel { public System.Guid Id { get; set; } public System.DateTime BackupDate { get; set; } public string BackupedBy { get; set; } public string BackupData { get; set; } public string CollectionName { get; set; } /// /// Casts a obect to the object of type . /// /// A object. /// A object filled with data from db. public static explicit operator MongoDBBackupModel(supt_tbl_MongoDBBackup obj) { if (obj == null) return null; var model = new MongoDBBackupModel { Id = obj.id, BackupData=obj.BackupData, BackupDate=obj.BackupDate, BackupedBy=obj.BackupedBy, CollectionName=obj.CollectionName }; model.TrimStringProperties(); return model; } /// /// Copies data from model to DAL object. /// /// A target DAL object. public void CopyTo(supt_tbl_MongoDBBackup dbObj) { if (dbObj == null) throw new ArgumentNullException(); dbObj.CollectionName = CollectionName; dbObj.BackupData = BackupData; dbObj.BackupDate = BackupDate; dbObj.BackupedBy = BackupedBy; } } }