Ejemplo n.º 1
0
        //public static VersionedPersistenceEntity CreateVersionedPersistenceEntity()
        //{
        //    var entity = new VersionedPersistenceEntity();
        //    //entity.Setup();
        //    entity.ConcurrencyToken = new BasicConcurrencyToken();
        //    entity.Revision = new RevisionData();
        //    entity.Revision.Changeset = new Changeset();
        //    entity.Revision.Changeset.Branch = new Branch();
        //    entity.UtcCreated = entity.UtcModified = entity.UtcStatusChanged = DateTime.UtcNow;
        //    entity.Status = new RevisionStatusType();
        //    return entity;
        //}

        public static AttributeType CreateAttributeType(string alias, string name, string description, bool assignId = false)
        {
            var atd = new AttributeType();

            atd.Setup(alias, name, description);
            atd.SerializationType = new StringSerializationType();
            if (assignId)
            {
                atd.Id = new HiveId(Guid.NewGuid());
            }
            return(atd);
        }
        //public static VersionedPersistenceEntity CreateVersionedPersistenceEntity()
        //{
        //    var entity = new VersionedPersistenceEntity();
        //    //entity.Setup();
        //    entity.ConcurrencyToken = new BasicConcurrencyToken();
        //    entity.Revision = new RevisionData();
        //    entity.Revision.Changeset = new Changeset();
        //    entity.Revision.Changeset.Branch = new Branch();
        //    entity.UtcCreated = entity.UtcModified = entity.UtcStatusChanged = DateTime.UtcNow;
        //    entity.Status = new RevisionStatusType();
        //    return entity;
        //}

        public static AttributeType CreateAttributeType(string alias, string name, string description, bool assignId = false)
        {
            var atd = new AttributeType();
            atd.Setup(alias, name, description);
            atd.SerializationType = new StringSerializationType();
            if (assignId)
                atd.Id = new HiveId(Guid.NewGuid());
            return atd;
        }