示例#1
0
 public override MixMedia ParseModel(MixCmsContext _context = null, IDbContextTransaction _transaction = null)
 {
     if (Id == 0)
     {
         Id = UpdateViewModel.Repository.Max(c => c.Id).Data + 1;
         CreatedDateTime = DateTime.UtcNow;
         IsClone         = true;
         Cultures        = Cultures ?? LoadCultures(Specificulture, _context, _transaction);
         Cultures.ForEach(c => c.IsSupported = true);
     }
     if (FileFolder[0] == '/')
     {
         FileFolder = FileFolder.Substring(1);
     }
     return(base.ParseModel(_context, _transaction));
 }
示例#2
0
 public override MixMedia ParseModel(MixCmsContext _context = null, IDbContextTransaction _transaction = null)
 {
     if (CreatedDateTime == default)
     {
         Id = Id > 0 ? Id : UpdateViewModel.Repository.Max(c => c.Id, _context, _transaction).Data + 1;
         CreatedDateTime = DateTime.UtcNow;
     }
     if (string.IsNullOrEmpty(TargetUrl))
     {
         if (FileFolder[0] == '/')
         {
             FileFolder = FileFolder.Substring(1);
         }
     }
     return(base.ParseModel(_context, _transaction));
 }
示例#3
0
 public override SioMedia ParseModel(SioCmsContext _context = null, IDbContextTransaction _transaction = null)
 {
     if (CreatedDateTime == default(DateTime))
     {
         Id = Id > 0 ? Id : UpdateViewModel.Repository.Max(c => c.Id).Data + 1;
         CreatedDateTime = DateTime.UtcNow;
         IsClone         = true;
         Cultures        = Cultures ?? LoadCultures(Specificulture, _context, _transaction);
         Cultures.ForEach(c => c.IsSupported = true);
     }
     if (string.IsNullOrEmpty(TargetUrl))
     {
         if (FileFolder[0] == '/')
         {
             FileFolder = FileFolder.Substring(1);
         }
     }
     return(base.ParseModel(_context, _transaction));
 }