Beispiel #1
0
        public AvatarType Create(AvatarType avatarType)
        {
            if (avatarType.AvatarTypeName != null)
            {
                _context.Attach(avatarType.AvatarTypeName).State = EntityState.Unchanged;
            }
            var avatarTypeEntry = _context.Add(avatarType);

            _context.SaveChanges();
            return(avatarTypeEntry.Entity);
        }
Beispiel #2
0
        public Owner Create(Owner owner)
        {
            if (owner.Address != null)
            {
                _context.Attach(owner.Address).State = EntityState.Unchanged;
            }
            var customerEntry = _context.Add(owner);

            _context.SaveChanges();
            return(customerEntry.Entity);
        }