Exemplo n.º 1
0
        public bool Add(UserRoleCountryCreateModel entity)
        {
            UserRoleCountry tuple = new UserRoleCountry
            {
                CountryId = entity.CountryId,
                ApplicationIdentityRoleId = entity.RoleId,
                ApplicationUserId         = entity.ApplicationUserId,
            };

            return(_repository.Add(tuple));
        }
Exemplo n.º 2
0
        public bool Update(UserRoleCountryEditModel entity)
        {
            UserRoleCountry tuple = _repository.Get(entity.Id);

            if (tuple == null)
            {
                throw new Exception(LOCALIZATION_GENERAL_NOT_FOUND + entity.Id);
            }

            tuple.ApplicationUserId         = entity.ApplicationUserId;
            tuple.ApplicationIdentityRoleId = entity.RoleId;

            return(_repository.Update(tuple));
        }