Example #1
0
 private string GetSecurityAttribute(OperationModel o)
 {
     if (o.HasStereotype("Secured") || Model.HasStereotype("Secured"))
     {
         var roles = o.GetStereotypeProperty <string>("Secured", "Roles");
         return(string.IsNullOrWhiteSpace(roles)
             ? "[Authorize]"
             : $"[Authorize(Roles = \"{roles}\")]");
     }
     return("[AllowAnonymous]");
 }
 public static bool IsAsync(this OperationModel operation)
 {
     return(operation.HasStereotype("Asynchronous"));
 }
 public static bool HasSynchronous(this OperationModel model)
 {
     return(model.HasStereotype("Synchronous"));
 }
Example #4
0
 public static bool HasUnsecured(this OperationModel model)
 {
     return(model.HasStereotype("Unsecured"));
 }
Example #5
0
 public static bool HasHttpSettings(this OperationModel model)
 {
     return(model.HasStereotype("Http Settings"));
 }
Example #6
0
 public static bool HasTransactionOptions(this OperationModel model)
 {
     return(model.HasStereotype("Transaction Options"));
 }