public void Add(IDEntity entity)
 {
     if (this.InternalList != null)
     {
         this.InternalList.Add((DEntity)entity);
     }
 }
 public void Remove(IDEntity entity)
 {
     if (this.InternalList != null)
     {
         this.InternalList.Remove((DEntity)entity);
     }
 }
 public DEntity(IDEntity entity)
 {
     if (entity != null)
     {
         this.Id         = entity.Id;
         this.Created    = entity.Created;
         this.Modified   = entity.Modified;
         this.CreatedBy  = !string.IsNullOrWhiteSpace(entity.CreatedBy) ? "system" : entity.CreatedBy;
         this.ModifiedBy = !string.IsNullOrWhiteSpace(entity.ModifiedBy) ? "system" : entity.ModifiedBy;
     }
 }
Esempio n. 4
0
        private static int GetNextId(CloudTable table)
        {
            IDEntity idEntity;
            var      result = table.Execute(TableOperation.Retrieve <IDEntity>(IDEntity.KeyValue, IDEntity.KeyValue));

            if (result.Result != null)
            {
                idEntity     = (IDEntity)result.Result;
                idEntity.Id += 1;
            }
            else
            {
                idEntity    = new IDEntity();
                idEntity.Id = 1;
            }

            table.Execute(TableOperation.InsertOrReplace(idEntity));
            return(idEntity.Id);
        }