Пример #1
0
 /// <summary>
 /// Enqueue <see cref="CostumeUnlock"/> to be deleted from the database.
 /// </summary>
 public void EnqueueDelete(bool set)
 {
     if (set)
     {
         saveMask |= CostumeUnlockSaveMask.Delete;
     }
     else
     {
         saveMask &= ~CostumeUnlockSaveMask.Delete;
     }
 }
Пример #2
0
        public void Save(AuthContext context)
        {
            if (saveMask == CostumeUnlockSaveMask.None)
            {
                return;
            }

            var model = new AccountCostumeUnlockModel
            {
                Id     = accountId,
                ItemId = ItemId
            };

            if ((saveMask & CostumeUnlockSaveMask.Create) != 0)
            {
                context.Add(model);
            }
            else
            {
                context.Entry(model).State = EntityState.Deleted;
            }

            saveMask = CostumeUnlockSaveMask.None;
        }
Пример #3
0
 /// <summary>
 /// Create a new <see cref="CostumeUnlock"/> from supplied item id.
 /// </summary>
 public CostumeUnlock(AccountModel account, uint itemId)
 {
     ItemId    = itemId;
     accountId = account.Id;
     saveMask  = CostumeUnlockSaveMask.Create;
 }