Exemplo n.º 1
0
 public void Add(ABSiteSetting item)
 {
     if (null != item)
     {
         UpdateOrAdd(item, item);
     }
 }
Exemplo n.º 2
0
 public ABSiteSetting Get(ABSiteSetting dummy)
 {
     var temp = _dbContext.ABSiteSettings.Where(it => it.UUID.Equals(dummy.UUID, StringComparison.OrdinalIgnoreCase)
         && it.SiteName.Equals(dummy.MainSite, StringComparison.OrdinalIgnoreCase))
         .ToList()
         .Select(it => it.ToABSiteSetting())
         .FirstOrDefault();
     return temp;
 }
Exemplo n.º 3
0
 public void Remove(ABSiteSetting item)
 {
     ((IPersistable)item).OnSaving();
     var dummy = _dbContext.ABSiteSettings.FirstOrDefault(it => it.UUID.Equals(item.UUID, StringComparison.OrdinalIgnoreCase)
         && it.SiteName.Equals(item.MainSite, StringComparison.OrdinalIgnoreCase));
     if (null != dummy)
     {
         _dbContext.ABSiteSettings.Remove(dummy);
         _dbContext.SaveChanges();
     }
     ((IPersistable)item).OnSaved();
 }
Exemplo n.º 4
0
 public void Remove(ABSiteSetting item)
 {
     DataHelper.DeleteItemByKey(new Site(), ModelExtensions.GetBucketDocumentKey(ModelExtensions.ABSiteSettingDataType, item.UUID));
 }
Exemplo n.º 5
0
 public void Update(ABSiteSetting @new, ABSiteSetting old)
 {
     InsertOrUpdate(@new, old);
 }
Exemplo n.º 6
0
 private void InsertOrUpdate(ABSiteSetting @new, ABSiteSetting old)
 {
     ((IPersistable)@new).OnSaving();
     DataHelper.StoreObject(new Site(), @new, @new.UUID, ModelExtensions.ABSiteSettingDataType);
     ((IPersistable)@new).OnSaved();
 }
Exemplo n.º 7
0
 public void Add(ABSiteSetting item)
 {
     InsertOrUpdate(item, item);
 }
Exemplo n.º 8
0
        public ABSiteSetting Get(ABSiteSetting dummy)
        {
            var bucketDocumentKey = ModelExtensions.GetBucketDocumentKey(ModelExtensions.ABSiteSettingDataType, dummy.UUID);

            return DataHelper.QueryByKey<ABSiteSetting>(new Site(), bucketDocumentKey, createModel);
        }
Exemplo n.º 9
0
 private void UpdateOrAdd(ABSiteSetting item, ABSiteSetting oldItem)
 {
     ((IPersistable)item).OnSaving();
     var dummy = _dbContext.ABSiteSettings.FirstOrDefault(it => it.UUID.Equals(oldItem.UUID, StringComparison.OrdinalIgnoreCase)
         && it.SiteName.Equals(oldItem.MainSite, StringComparison.OrdinalIgnoreCase));
     if (null != dummy)
     {
         item.ToABSiteSettingEntity<ABSiteSettingEntity>(dummy);
     }
     else
     {
         dummy = item.ToABSiteSettingEntity<ABSiteSettingEntity>();
         _dbContext.ABSiteSettings.Add(dummy);
     }
     _dbContext.SaveChanges();
     ((IPersistable)item).OnSaved();
 }
Exemplo n.º 10
0
 public void Update(ABSiteSetting @new, ABSiteSetting old)
 {
     UpdateOrAdd(@new, old);
 }
        public virtual void Update(ABSiteSetting @new, ABSiteSetting old)
        {
            var fileStorage = GetFileStorage();

            fileStorage.Update(@new, old);
        }
        public virtual void Remove(ABSiteSetting item)
        {
            var fileStorage = GetFileStorage();

            fileStorage.Remove(item);
        }
        public virtual ABSiteSetting Get(ABSiteSetting dummy)
        {
            var fileStorage = GetFileStorage();

            return fileStorage.Get(dummy);
        }
        public virtual void Add(ABSiteSetting item)
        {
            var fileStorage = GetFileStorage();

            fileStorage.Add(item);
        }