public void CtorODataModelAttribute_SetsModel() { // Assert & Act & Assert ODataModelAttribute odataModel = new ODataModelAttribute(); Assert.Equal(string.Empty, odataModel.Model); // Assert & Act & Assert odataModel = new ODataModelAttribute("odata"); Assert.Equal("odata", odataModel.Model); }
private static bool CanApply(string prefix, ControllerModel controller) { ODataModelAttribute odataModel = controller.GetAttribute <ODataModelAttribute>(); if (odataModel == null) { return(true); // apply to all model } else if (prefix == odataModel.Model) { return(true); } return(false); }