using System; using System.Collections.Generic; using System.Linq; using System.Numerics; using System.Text; using System.Threading.Tasks; using System.Xml.Linq; using ServerCore; using ServerBase; namespace ServerCommon; public class UserSocialActionAttribute : SocialActionAttributeBase { public UserSocialActionAttribute(EntityBase owner) : base(owner) { } public override IEntityAttributeTransactor onNewEntityAttributeTransactor() { var owner = getOwner(); NullReferenceCheckHelper.throwIfNull(owner, () => $"owner is null !!!"); var parent = owner.getRootParent(); NullReferenceCheckHelper.throwIfNull(parent, () => $"parent is null !!! - {owner.toBasicString()}"); return new UserSocialActionAttributeTransactor(owner); } public override EntityAttributeBase onCloned() { var owner = getOwner(); NullReferenceCheckHelper.throwIfNull(owner, () => $"owner is null !!!"); var parent = owner.getRootParent(); NullReferenceCheckHelper.throwIfNull(parent, () => $"parent is null !!! - {owner.toBasicString()}"); var cloned = new UserSocialActionAttribute(owner); cloned.deepCopyFromBase(this); cloned.SocialActionMetaId = SocialActionMetaId; cloned.EquipedPos = EquipedPos; return cloned; } public override DynamoDbDocBase onCreateDocBase() { var owner = getOwner(); NullReferenceCheckHelper.throwIfNull(owner, () => $"owner is null !!!"); var parent = owner.getRootParent(); NullReferenceCheckHelper.throwIfNull(parent, () => $"parent is null !!! - {owner.toBasicString()}"); var user_attribute = parent.getEntityAttribute(); NullReferenceCheckHelper.throwIfNull(user_attribute, () => $"user_attribute is null !!! - {owner.toBasicString()}"); var user_guid = user_attribute.UserGuid; return new SocialActionDoc(OwnerEntityType.User, user_guid, SocialActionMetaId); } } public class UserSocialActionAttributeTransactor : SocialActionAttributeBaseTransactor { public UserSocialActionAttributeTransactor(EntityBase owner) : base(owner) { } }