Пример #1
0
        public void CreateOrUpdate(uint id, string name, string email)
        {
            var existingGameAccount = _charContext.GetWritable(_charContext.GameAccountEntries, id);

            if (existingGameAccount != null)
            {
                existingGameAccount.Name  = name;
                existingGameAccount.Email = email;
            }
            else
            {
                var newEntry = new GameAccountEntry
                {
                    Id    = id,
                    Name  = name,
                    Email = email
                };
                _charContext.GameAccountEntries.Add(newEntry);
                _charContext.SaveChanges();
            }
        }