Exemplo n.º 1
0
        protected override TRole Assign(TXPORole source, TRole destination)
        {
            if (source == null)
            {
                throw new ArgumentNullException("source");
            }
            if (destination == null)
            {
                throw new ArgumentNullException("destination");
            }

            destination.ID   = source.ID;
            destination.Name = source.Name;
#if (NETSTANDARD2_0)
            destination.NormalizedName = source.NormalizedName;
#endif
            return(destination);
        }
Exemplo n.º 2
0
        public Task UpdateAsync(TRole role)
        {
            ThrowIfDisposed();
            if (role == null)
            {
                throw new ArgumentNullException("roleName");
            }

            return(Task.FromResult(XPOExecute <object>((db, wrk) =>
            {
                TXPORole r = wrk.GetObjectByKey(XPORoleType, role.Id) as TXPORole;
                if (r != null)
                {
                    r.Assign(role, 0);
                }
                return null;
            })));
        }