public Group() { InstanceId = IDUtils.NewGuid(); Id = IDUtils.NewGuid(); this.studyUnitRelPathNames = new List <string>(); ConceptSchemeCompareTable = new CompareTable() { CompareType = CompareTable.CompareTypes.ConceptScheme }; ConceptCompareTable = new CompareTable() { CompareType = CompareTable.CompareTypes.Concept }; VariableCompareTable = new CompareTable() { CompareType = CompareTable.CompareTypes.Variable }; PurposeId = IDUtils.NewGuid(); ComparisonId = IDUtils.NewGuid(); SharedStudyUnit = new StudyUnit(); //Variables to be shared within the group SharedStudyUnit.Abstract.Title = SHARED_STUDY_UNIT_TITLE; Organization organization = new Organization(); Member member = new Member(); member.OrganizationId = organization.Id; SharedStudyUnit.AddMember(member); SharedStudyUnit.AddOrganization(organization); SharedStudyUnit.Samplings.Add(new Sampling()); SharedStudyUnit.Samplings[0].MemberId = member.Id; SharedStudyUnit.Samplings[0].DateRange = new DateRange(DateTime.Today, DateTime.Today); }
public EntityChange( string auditLogId, EntityChangeInfo entityChangeInfo, string tenantId = null) { Id = IDUtils.NewIdString(); AuditLogId = auditLogId; TenantId = tenantId; ChangeTime = entityChangeInfo.ChangeTime; ChangeType = entityChangeInfo.ChangeType; EntityId = entityChangeInfo.EntityId.Truncate(EntityChangeConsts.MaxEntityTypeFullNameLength); EntityTypeFullName = entityChangeInfo.EntityTypeFullName.TruncateFromBeginning(EntityChangeConsts.MaxEntityTypeFullNameLength); PropertyChanges = entityChangeInfo .PropertyChanges? .Select(p => new EntityPropertyChange(Id, p, tenantId)) .ToList() ?? new List <EntityPropertyChange>(); ExtraProperties = new ExtraPropertyDictionary(); if (entityChangeInfo.ExtraProperties != null) { foreach (var pair in entityChangeInfo.ExtraProperties) { ExtraProperties.Add(pair.Key, pair.Value); } } }
public async Task IndexAsync() { //var post = new Post //{ // Title = "Hello World" //}; //var request = new IndexRequest<Post>(post); //var response = _client.Index(post, idx => idx.Index("post")); var collection = new string[] { "A", "B", "C", "D" }; foreach (var item in collection) { var user = new User { Id = IDUtils.NewId(), Name = item }; var request = new IndexRequest <User>(user); var response = await _client.IndexAsync(user, idx => idx.Index(nameof(User).ToLower())); Assert.True(response.ApiCall.Success); } }
public async Task <Tenant> CreateAsync(string name) { Check.NotNull(name, nameof(name)); await ValidateNameAsync(name); return(new Tenant(IDUtils.NewId().ToString(), name)); }
public Response(Option type) { Id = IDUtils.NewGuid(); TypeCode = type.Code; MissingValues = new List <MissingValue>(); Layout = null; Scale = EDOConstants.DEF_SCALE; }
public Response Dup() { Response newResponseModel = Clone() as Response; //replicate new answers itself newResponseModel.Id = IDUtils.NewGuid(); return(newResponseModel); }
protected virtual void TrySetGuidId(IEntity <Guid> entity) { if (entity.Id != default) { return; } EntityHelper.TrySetId(entity, IDUtils.NewIdString(), true); }
protected virtual void SetId <TEntity>(TEntity entity) { if (entity is IEntity <string> entityWithStringId) { if (string.IsNullOrWhiteSpace(entityWithStringId.Id)) { entityWithStringId.Id = IDUtils.NewId().ToString(); } } }
public ControlConstructScheme() { Id = IDUtils.NewGuid(); QuestionConstructs = new List <QuestionConstruct>(); QuestionGroupConstructs = new List <QuestionGroupConstruct>(); Statements = new List <Statement>(); IfThenElses = new List <IfThenElse>(); Sequence = new Sequence(); RenumberQuestionNo = true; }
public DataFile() { Id = IDUtils.NewGuid(); GrossRecordStructureId = IDUtils.NewGuid(); RecordLayoutId = IDUtils.NewGuid(); PhysicalRecordSegment = "Segment_" + IDUtils.NewGuid(); PhysicalInstanceId = IDUtils.NewGuid(); DataFileIdentificationId = IDUtils.NewGuid(); GrossFileStructureId = IDUtils.NewGuid(); }
/// <summary> /// 授权 /// </summary> /// <param name="name"></param> /// <param name="providerKey"></param> /// <returns></returns> protected virtual async Task GrantAsync(string name, string providerKey) { var permissionGrant = await PermissionGrantRepository.FindAsync(name, Name, providerKey); if (permissionGrant != null) { return; } await PermissionGrantRepository.InsertAsync(new PermissionGrant(IDUtils.NewId(), name, Name, providerKey, CurrentTenant.Id)); }
public async Task SeedAsync(string providerName, string providerKey, IEnumerable <string> grantedPermissions, string tenantId = default) { foreach (var permissionName in grantedPermissions) { if (await PermissionGrantRepository.FindAsync(permissionName, providerName, providerKey) != null) { continue; } await PermissionGrantRepository.InsertAsync(new PermissionGrant(IDUtils.NewId(), permissionName, providerName, providerKey, tenantId)); } }
public Sampling() { Id = IDUtils.NewGuid(); DateRange = new DateRange(); CollectionEventId = IDUtils.NewGuid(); ModeOfCollectionId = IDUtils.NewGuid(); CollectionSituationId = IDUtils.NewGuid(); Universes = new List <Universe>(); SamplingNumbers = new List <SamplingNumber>(); CollectorTypeCode = DefaultCollectorType; }
public EntityPropertyChange( string entityChangeId, EntityPropertyChangeInfo entityChangeInfo, string tenantId = null) { Id = IDUtils.NewIdString(); TenantId = tenantId; EntityChangeId = entityChangeId; NewValue = entityChangeInfo.NewValue.Truncate(EntityPropertyChangeConsts.MaxNewValueLength); OriginalValue = entityChangeInfo.OriginalValue.Truncate(EntityPropertyChangeConsts.MaxOriginalValueLength); PropertyName = entityChangeInfo.PropertyName.TruncateFromBeginning(EntityPropertyChangeConsts.MaxPropertyNameLength); PropertyTypeFullName = entityChangeInfo.PropertyTypeFullName.TruncateFromBeginning(EntityPropertyChangeConsts.MaxPropertyTypeFullNameLength); }
public async Task SearchAsync() { var user = new User { Id = IDUtils.NewId(), }; var request = new SearchRequest <User>(); var response = await _client.SearchAsync <User>(); Assert.True(response.ApiCall.Success); }
public void CreateDocument() { var user = new User { Id = IDUtils.NewId(), Name = DateTimeOffset.Now.ToString("yyyyMMddHHmmssfff") }; var request = new CreateRequest <User>(user.Id); var response = _client.CreateDocument(user); Assert.True(response.ApiCall.Success); }
public Coverage() { Id = IDUtils.NewGuid(); TopicalCoverageId = IDUtils.NewGuid(); TemporalCoverageId = IDUtils.NewGuid(); SpatialCoverageId = IDUtils.NewGuid(); //it is not possible to be managed by List <string> since memo and code must be stored in a set Topics = new List <CheckOption>(); Keywords = new List <Keyword>(); DateRange = new DateRange(); Areas = new List <CheckOption>(); GeographicStructureIdSuffix = IDUtils.NewGuid(); GeographicIdSuffix = IDUtils.NewGuid(); }
/// <summary> /// Creates a new Edge between the given from- and to-node and adds it to the edges-list /// </summary> /// <param name="from">The start-node of the new edge</param> /// <param name="to">The end-node of the new edge</param> /// <returns>The newly created edge.</returns> public Edge CreateEdge(Node from, Node to) { //Debug.Log("Graph: Create Edge for From-Node " + from.Id + " and To-Node " + to.Id); // Declare and instantiate a new Edge between the given nodes with a unique ID... Edge newEdge = new Edge( this, IDUtils.GetUniqueID("Edge", string.Empty, this.edges, 10000), from, to); // ... add the new edge to the edges-list... AddEdge(newEdge); // ...and return the new edge. return(newEdge); }
private static RenameResult RenameId(IIDPropertiesProvider obj, string propertyName, List <string> ids) { RenameResult result = new RenameResult(propertyName); string id = (string)PropertyPathHelper.GetValue(obj, propertyName); if (ids.Contains(id)) { string newId = IDUtils.NewGuid(); PropertyPathHelper.SetValue(obj, propertyName, newId); result.OldId = id; result.NewId = newId; return(result); } return(result); }
/// <summary> /// Creates a new Node with the given position, generating a unique ID /// </summary> /// <param name="position"></param> /// <returns></returns> public Node CreateNode(Vector3 position) { //Debug.Log("Graph: Create Node at Position " + position); // Declare and instantiate a new node with a unique ID... Node newNode = new Node( this, IDUtils.GetUniqueID("Node", string.Empty, this.nodes, 10000), position); // ... add the node to the nodes-list... AddNode(newNode); // ... and return the new node. return(newNode); }
public virtual async Task SetAsync(string name, string value, string providerName, string providerKey) { var setting = await SettingRepository.FindAsync(name, providerName, providerKey); if (setting == null) { setting = new Setting(IDUtils.NewIdString(), name, value, providerName, providerKey); await SettingRepository.InsertAsync(setting); } else { setting.Value = value; await SettingRepository.UpdateAsync(setting); } await Cache.SetAsync(CalculateCacheKey(name, providerName, providerKey), new SettingCacheItem(setting?.Value), considerUow : true); }
public StudyUnit() { this.Id = IDUtils.NewGuid(); //1 this.Events = new List <Event>(); //*1 this.Members = new List <Member>(); //*2 this.Organizations = new List <Organization>(); //*3 this.Abstract = new Abstract(); //*4 this.Coverage = new Coverage(); //*5 this.FundingInfos = new List <FundingInfo>(); //*6 this.Universes = new List <Universe>(); //*7 this.Samplings = new List <Sampling>(); //*8 this.ConceptSchemes = new List <ConceptScheme>(); //*9 this.Questions = new List <Question>(); //*10 this.CategorySchemes = new List <CategoryScheme>(); //*11 this.CodeSchemes = new List <CodeScheme>(); //*12 this.VariableScheme = new VariableScheme(); //*13 this.Variables = new List <Variable>(); //*14 this.DataSets = new List <DataSet>(); //*15 this.DataFiles = new List <DataFile>(); //*16 this.ControlConstructSchemes = new List <ControlConstructScheme>(); //*17 this.QuestionGroups = new List <QuestionGroup>(); this.Books = new List <Book>(); this.StatisticsInfos = new List <StatisticsInfo>(); this.InstanceId = IDUtils.NewGuid(); //2 this.UniverseSchemeId = IDUtils.NewGuid(); //3 this.ConceptualComponentId = IDUtils.NewGuid(); //4 this.GeographicStructureSchemeId = IDUtils.NewGuid(); //5 this.DataCollectionId = IDUtils.NewGuid(); //6 this.QuestionSchemeId = IDUtils.NewGuid(); //7 this.LogicalProductId = IDUtils.NewGuid(); //8 this.DataRelationshipId = IDUtils.NewGuid(); //9 this.PhysicalDataProductId = IDUtils.NewGuid(); //10 this.PhysicalStructureSchemeId = IDUtils.NewGuid(); //11 this.RecordLayoutSchemeId = IDUtils.NewGuid(); //12 this.ArchiveId = IDUtils.NewGuid(); //13 this.OrganizationSchemeId = IDUtils.NewGuid(); //14 this.MethodologyId = IDUtils.NewGuid(); //15 this.ProcessingEventId = IDUtils.NewGuid(); //16 }
public Sequence() { Id = IDUtils.NewGuid(); ControlConstructIds = new List <string>(); }
public Universe() { IsMain = false; Id = IDUtils.NewGuid(); SamplingProcedureId = IDUtils.NewGuid(); }
public IfThenElse() { Id = IDUtils.NewGuid(); IfCondition = new IfCondition(); ElseIfs = new List <ElseIf>(); }
public QuestionConstruct() { Id = IDUtils.NewGuid(); }
public new void PickID() { ID = IDUtils.PickID <Quest>(); }
public IntegrationEvent() { Id = IDUtils.GenerateId(); Timestamp = DateTime.UtcNow.ToUnixTimeSeconds(); }
public Node(Graph graph, Vector3 position) : this(graph) { this.id = IDUtils.GetUniqueID("Node", string.Empty, this.graph.Nodes, 10000); this._position = position; }
public Statement() { Id = IDUtils.NewGuid(); }