Exemplo n.º 1
0
 /// <summary>
 /// Create a new UniqueId object.
 /// </summary>
 /// <param name="entityId">Initial value of the EntityId property.</param>
 /// <param name="uniqueIdTypeId">Initial value of the UniqueIdTypeId property.</param>
 /// <param name="uniqueIdValue">Initial value of the UniqueIdValue property.</param>
 public static UniqueId CreateUniqueId(global::System.Int32 entityId, global::System.Int32 uniqueIdTypeId, global::System.String uniqueIdValue)
 {
     UniqueId uniqueId = new UniqueId();
     uniqueId.EntityId = entityId;
     uniqueId.UniqueIdTypeId = uniqueIdTypeId;
     uniqueId.UniqueIdValue = uniqueIdValue;
     return uniqueId;
 }
Exemplo n.º 2
0
        /// <summary>
        /// SyncUniqueId method
        /// </summary>
        /// <param name="simplUser"></param>
        /// <param name="db"></param>
        /// <param name="userId"></param>
        public void SyncUniqueId(Entity simplUser, SIMPLEntities db, string userId)
        {
            //see if id exists in unique ids table. if not, add it
            var id = db.UniqueIds.FirstOrDefault(u => u.UniqueIdValue == userId);
            if (id != null) return;

            id = new UniqueId
            {
                EntityId = simplUser.EntityId,
                UniqueIdTypeId = RegexValidator.DetermineUniqueIdType(userId),
                UniqueIdValue = userId
            };
            db.UniqueIds.AddObject(id);
        }
Exemplo n.º 3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the UniqueIds EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToUniqueIds(UniqueId uniqueId)
 {
     base.AddObject("UniqueIds", uniqueId);
 }