public IHttpActionResult Get([FromUri] string name) { try { Utils.IsAValidToken(Request, AuthorizationBusinessLogic); Utils.HasAdminPermissions(Request, AuthorizationBusinessLogic); Style style = StyleBusinessLogic.Get(name); return(Ok(StyleModel.ToModel(style))); } catch (Exception e) { return(BadRequest(e.Message)); } }
public IHttpActionResult Get() { try { Utils.IsAValidToken(Request, AuthorizationBusinessLogic); Utils.HasAdminPermissions(Request, AuthorizationBusinessLogic); IList <Style> styles = StyleBusinessLogic.Get(); IList <StyleModel> stylesModels = Utils.ConvertEntitiesToModels(styles); return(Ok(stylesModels)); } catch (Exception e) { return(BadRequest(e.Message)); } }