Skip to content

Support generic type at Enforce APIs #94

@sagilio

Description

@sagilio

A improvement of #101

Description

This will help to compile the expression. It has supported a part on Pull Request #93.

Changes

  • Change the enforce method signature to a supported generic type.

We can support compile the expression better than now, here is some example:

var enforcer = new Enforcer();

var testUser = new TestUser();
// it will call method:
// Enforce<T1>(T1 value1, string value2, string value3);
enforcer.Enforce(testUser, resource, action); 

var testResource = new TestResource();
// it will call method:
// Enforce<T1, T2>(T1 value1, T2 value2, string value3);
enforcer.Enforce(testUser, testResource, action); 

// it will call method:
// Enforce<T1, T2, T3, T4, T5,>(T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, params object[] otherValues);
enforcer.Enforce(testUser, testResource, action, customValue1, customValue2, customValue3); 

Metadata

Metadata

Assignees

Labels

enhancementEnhancement the exist feature

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions