public static coreModel.Asset ToCoreModel(this webModel.Asset asset) { var retVal = new coreModel.Asset(); retVal.InjectFrom(asset); retVal.Url = asset.RelativeUrl; return retVal; }
/// <summary> /// Converting to model type /// </summary> /// <param name="catalogBase"></param> /// <returns></returns> public static coreModel.Asset ToCoreModel(this dataModel.Asset dbAsset) { if (dbAsset == null) throw new ArgumentNullException("dbAsset"); var retVal = new coreModel.Asset(); retVal.InjectFrom(dbAsset); return retVal; }
public object Clone() { var retVal = new Asset(); retVal.CreatedBy = CreatedBy; retVal.CreatedDate = CreatedDate; retVal.ModifiedBy = ModifiedBy; retVal.ModifiedDate = ModifiedDate; retVal.Name = Name; retVal.Url = Url; retVal.Group = Group; retVal.LanguageCode = LanguageCode; retVal.MimeType = MimeType; retVal.Size = Size; retVal.IsInherited = IsInherited; if (SeoInfos != null) { retVal.SeoInfos = SeoInfos.Select(x => x.Clone()).OfType<SeoInfo>().ToList(); } return retVal; }