/// <summary> /// Creates the entity object. /// </summary> /// <param name="metaClassName">Name of the meta class.</param> /// <param name="primaryKeyId">The primary key id.</param> /// <returns></returns> protected override EntityObject CreateEntityObject(string metaClassName, PrimaryKeyId?primaryKeyId) { if (metaClassName == DirectoryUserEntity.ClassName) { DirectoryUserEntity retVal = new DirectoryUserEntity(); retVal.PrimaryKeyId = primaryKeyId; return(retVal); } return(base.CreateEntityObject(metaClassName, primaryKeyId)); }
/// <summary> /// Creates the entity object. /// </summary> /// <param name="metaClassName">Name of the meta class.</param> /// <param name="primaryKeyId">The primary key id.</param> /// <returns></returns> protected override EntityObject CreateEntityObject(string metaClassName, PrimaryKeyId? primaryKeyId) { if (metaClassName == DirectoryUserEntity.ClassName) { DirectoryUserEntity retVal = new DirectoryUserEntity(); retVal.PrimaryKeyId = primaryKeyId; return retVal; } return base.CreateEntityObject(metaClassName, primaryKeyId); }
/// <summary> /// Pres the create. /// </summary> /// <param name="context">The context.</param> protected override void PreCreate(BusinessContext context) { base.PreCreate(context); #region Fill Contact FullName = LastName FirstName MiddleName DirectoryUserEntity user = (DirectoryUserEntity)context.Request.Target; if (string.IsNullOrEmpty(user.FullName)) { user.FullName = user.Properties.GetValue <string>(DirectoryUserEntity.FieldLastName, string.Empty) + " " + user.Properties.GetValue <string>(DirectoryUserEntity.FieldFirstName, string.Empty) + " " + user.Properties.GetValue <string>(DirectoryUserEntity.FieldMiddleName, string.Empty); } #endregion }