public bool Add(UserRoleCountryCreateModel entity) { UserRoleCountry tuple = new UserRoleCountry { CountryId = entity.CountryId, ApplicationIdentityRoleId = entity.RoleId, ApplicationUserId = entity.ApplicationUserId, }; return(_repository.Add(tuple)); }
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)); }