public static void BaseOnPostBuild(this User @this, ObjectOnPostBuild method) { if (@this.ExistUserName && [email protected]) { @this.UserProfile = new UserProfileBuilder(@this.Strategy.Session).Build(); } }
public void BaseOnPostBuild(ObjectOnPostBuild method) { if (!this.ExistIssuanceDateTime) { this.IssuanceDateTime = this.Strategy.Session.Now(); } }
public static void BaseOnPostBuild(this Domain.Object @this, ObjectOnPostBuild method) { // TODO: Optimize foreach (var concreteRoleType in ((Class)@this.Strategy.Class).ConcreteRoleTypes) { if (concreteRoleType.IsRequired) { var relationType = concreteRoleType.RelationType; var unit = relationType.RoleType.ObjectType as IUnit; if (unit != null && [email protected](relationType)) { switch (unit.UnitTag) { case UnitTags.Boolean: @this.Strategy.SetUnitRole(relationType, false); break; case UnitTags.Decimal: @this.Strategy.SetUnitRole(relationType, 0m); break; case UnitTags.Float: @this.Strategy.SetUnitRole(relationType, 0d); break; case UnitTags.Integer: @this.Strategy.SetUnitRole(relationType, 0); break; case UnitTags.Unique: @this.Strategy.SetUnitRole(relationType, Guid.NewGuid()); break; case UnitTags.DateTime: @this.Strategy.SetUnitRole(relationType, @this.Strategy.Session.Now()); break; } } } } }