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]"); }
public override string AfterTransaction(IServiceModel service, IOperationModel operation) => !operation.HasStereotype("ReadOnly") ? @" _businessQueue.NotifyQueueProcessors();" : "";
public override string AfterCallToAppLayer(IServiceModel service, IOperationModel operation) => !operation.HasStereotype("ReadOnly") ? @" _businessQueue.Flush();" : "";
public static bool IsAsync(this IOperationModel operation) { return(operation.HasStereotype("Asynchronous")); }