Exemple #1
0
        public void Save(AuthContext context)
        {
            if (saveMask == CostumeUnlockSaveMask.None)
            {
                return;
            }

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

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

            saveMask = CostumeUnlockSaveMask.None;
        }
Exemple #2
0
 /// <summary>
 /// Create a new <see cref="CostumeUnlock"/> from an existing <see cref="AccountCostumeUnlock"/> database model.
 /// </summary>
 public CostumeUnlock(AccountCostumeUnlock model)
 {
     ItemId    = model.ItemId;
     accountId = model.Id;
 }