private string GetSecurityAttribute(IOperationModel o)
 {
     if (o.HasStereotype("Secured") || Model.HasStereotype("Secured"))
     {
         var roles = o.GetPropertyValue <string>("Secured", "Roles");
         return(string.IsNullOrWhiteSpace(roles)
             ? "[Authorize]"
             : $"[Authorize(Roles = \"{roles}\")]");
     }
     return("[AllowAnonymous]");
 }
示例#2
0
 public override string AfterTransaction(IServiceModel service, IOperationModel operation) => !operation.HasStereotype("ReadOnly") ? @"
         _businessQueue.NotifyQueueProcessors();" : "";
示例#3
0
 public override string AfterCallToAppLayer(IServiceModel service, IOperationModel operation) => !operation.HasStereotype("ReadOnly") ? @"
             _businessQueue.Flush();" : "";
示例#4
0
 public static bool IsAsync(this IOperationModel operation)
 {
     return(operation.HasStereotype("Asynchronous"));
 }